You are viewing limited content. For full access, please sign in.

Question

Question

Collection Variable syntax is not parsing variables

asked on March 24, 2020 Show version history

According to the help files and this answer:

https://answers.laserfiche.com/questions/147140/Renaming-Attachments-from-Collections#147142

by Kathleen Park, you should be able to isolate variables from fields in a collection by using this syntax:

{/dataset/Collection/Type[Row()]}  in a Save to Laserfiche Service Task.

We are using this naming convention for a field named doctype2:

{/dataset/Collection_1/doctype2[Row()]}

on a form for file uploads and want to allow the user to pick a different document type assignment for each file uploaded.  The field gets populated, but all of the values are concatenated and look like this:

"Certifications,Requisition for Personnel"

Or like this:

 

The Forms version is Laserfiche Forms Professional Version 10.4.0.1256, and this was introduced in 10.2.1. 

I realize we could use a For Each Row task in Workflow, but this method seems much more convenient.

Has there been a change in how this syntax is used?  Thanks -

1 0

Replies

replied on March 25, 2020

Hi Bill, not sure if my settings are similar as yours on Forms 10.4.0.1256 , but I did get an expected result. Here is what I did:

I set for the uploaded file name and repository field value to {/dataset/Collection/Doc_Type[Row()]}. Doc_Type is a drop-down field in the same collection with the file upload field, which is for selecting different document type for each file uploaded. This is what they looks like in Forms: (see the attached png) 

After I submitted the form, the token value in "Doc_Type" when filling the form were retrieved and filled in their repository field and their name as expected and they are not concatenated.

For example, there are 2 choices in the drop-down field "Doc Type": Type A, Type B, checking in the repository the uploaded files are named as "File - Type A" and "File - Type B", their Type field are filled with "Type A" and "Type B" separately as well.

Please correct me if I misunderstand what you mean. And if all your settings are correct, please open a support case so we can better troubleshoot this issue.

2020-03-25_1604.png
2 0
replied on March 25, 2020

Adam figured this one out: The template field we were linking with the collection was set to multi value.  It looks like Forms was then collecting all of the values in all of the collections and posting them to each of the individual templates, that is, all values were being send to the template for every attachment.  When we changed the target field to single value, it worked exactly as described.

2 0
replied on April 15, 2022

This bug has been fixed in Forms 11. No matter the template field is set to multi value or not, the syntax such as {/dataset/Collection_1/doctype2[Row()]} will get the files from same row.

1 0
replied on March 24, 2020

The syntax has not changed, the following excerpt from the documentation is still valid: 

Note: In Laserfiche Forms 10.2 and later, the Save to Repository Service Task supports process variables that can retrieve values from a specific row in a table or a set in a collection that can be used in a document name or template field. For example, design a table with a "single line" field and a "file upload" field. If the table has 2 rows of values, setting the file upload document name in the Save to Repository Service Task to {/dataset/Table_variable_name/Single_Line_variable_name[Row()]} will set the first file with the first row's value and the second file with the second row's value.

1 0
replied on March 24, 2020

Thanks Jarad - I read that same section and used the same syntax, but did not get the same results.  Do you think this is a support case?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.