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

Question

Question

In Forms 10, are you able to relate field values to a file upload in a given row?

asked on December 14, 2015 Show version history

For instance, if you have a table with the following columns (Doc Type, Doc Description, and File Upload), are you able to relate the Doc Type and Doc Description in that given row to the FIle Upload?

When we save the attachment to Laserfiche, there is no way for us to relate that document to the data in that row. It basically saves all the data in the fields, rather than what is specific to that row.

See screen shots.

We should be able to grab each Attachment and assign the Table values for that row to the template we assign it. 

2015-12-14 11_29_56-zzIncoming Forms - Laserfiche.png
2015-12-14 11_42_44-Thank you.png
2015-12-14 11_43_50-Process Diagram _ Laserfiche Forms.png
3 0

Answers

APPROVED ANSWER
replied on August 21, 2018 Show version history

This may have been answered already in another post but I was encountering the same issue the other day so I wanted to share what worked for me.

Starting with version Forms v10.2.1, you now have the ability to apply an index directly on the variable in the table and it will automatically associate metadata from the corresponding row for each attachment.

The syntax is {/dataset/Table/Column_1[Row()]}. In this example, the Table is the variable for my table and Column_1 is the variable for my field that I want to assign as metadata to my attachment. You can do this mapping entirely within forms (save to repository task) and won't need to use workflow. 

Hope this is helpful to others!

16 0
SELECTED ANSWER
replied on December 16, 2015

Like Ege said above, Workflow can do it. For fields in a table or collection, you can get the row they're in and use it to pull out the other rows to make sure you're assigning the right metadata.

I'll try to explain it below. The major change to your process would be that you would have Forms save the form to Laserfiche, but pass the saving of attachments on to Workflow.

The workflow process can be started either from a service task in Forms or from the form saved to Laserfiche as long as Forms sets the instance ID and submission ID as field values.

The screenshot below assumes the workflow is started from Forms. If starting from LF, you will need to add a Retrieve Field Values at the top to read the instance ID and submission ID from the starting entry and set them in the advanced properties of Retrieve Forms Content.

In the example below, my form has a table with 2 columns: column 1 (text) and column 2 (file upload). The workflow adds each uploaded file to Laserfiche and sets the corresponding value from column 1 as a field value.

For the purpose of this example, let's say the form looks like this when submitted:

When Workflow retrieves its data, it generates a multi-value token with the column data for each column. These tokens are named after the activity, table and column. So for my unimaginatively named table and column: %(RetrieveLaserficheFormsContent_Table\Column_1). For my sample form, this is a multi-value token that contains the 2 values: A and B.

Workflow also retrieves the attachments as a file collection that we can process with For Each File:

Each file generates tokens for its name, path, size and extension. The path refers to the file's location in the rows in the table by table and column names: TableName\ColumnName\RowNumber. So for the first 2 in my sample form, the path in my table would be Table\Column_2\1, the next 2 would be Table\Column_2\2.

We can use this path and regular expression to extract the row number from the end and assign it to a token.

This would generate a token with the value "1" for the first 2 attachments and the value "2" for the next 2.

We then create an empty document in Laserfiche, attach the current file as an electronic component and assign the field.

To assign the field value, we use the row number above to get the corresponding value out of the multi-value token for the other column.

For the first 2 attachments, this will return Column 1's value from the first row, "A", while the next 2 would get the value from row 2, "B".

Let me know if this doesn't quite make sense.

 

2 0
replied on December 16, 2015 Show version history

So I this did work for me. 

The only issue is that with Workflow 10, I did not have the ability to retrieve the Current File Upload Path. It was not listed in the drop down.

I manually entered it in and it did work.

As well, when I add the "Retrieve Laserfiche Forms Content" activity, it lists it in the workflow as "Retrieve Business Process Variables." 

Not sure if you all were aware of this. 

 

 

2015-12-16 13_12_04-.png
2015-12-16 13_12_30-Workflow Designer.png
0 0
replied on December 16, 2015

Yeah the activity name changed in version 10. Does the same thing though.

0 0
replied on December 16, 2015

The token lists are filtered by token type to the most likely useful tokens. The Current File Path token is available through the Token Dialog, which lists all tokens.

0 0
replied on June 20, 2017

Hi Miruna,

This works well. I have a couple of follow-up questions for you, if you don't mind:

1. How you prevent form from saving the attachments? I've been saving to a folder called "delete me" and having workflow delete the files.

2. JPGs and BMPs have to run through an additional script to convert them from "edoc" to "image". The script works fine but is there another, code-free, way?

-Ben

0 0

Replies

replied on December 17, 2015 Show version history

Several Questions: 

  1. When will we be able to relay the column data to the file uploads within a "Save to Laserfiche" activity? 
  2. Is there a way to prevent the "Save to Laserfiche" activity from importing the attachments after workflow has created and uploaded the attachments to the repository? 
1 0
replied on December 17, 2015

Sorry about that, I didn't realize that Forms didn't have an option to save only the form.

I would modify the Forms task to save them into an "Attachments" subfolder in the same location as the starting form. Then I would have the workflow above start from the document creation for the starting form. At the end of this workflow, I'd add an activity that just deletes the %(Entry Path)\Attachments subfolder. By putting the action at the end, you give Forms enough time to finish saving the attachments (since that's done asynchronously and may take a little bit).

1 0
replied on December 17, 2015

Yeah, this is exactly what we do for some of our forms and it works great.

0 0
replied on December 17, 2015 Show version history

This workaround requires additional resources that shouldn't be necessary. When will this feature be added? I understand the workaround with Workflow, but then to have to create a subfolder to delete copies of the attachments I already received seems like a mess.

0 1
replied on December 17, 2015 Show version history

I don't see why it's a mess. It's literally two more activities in the workflow.

You don't have to use a subfolder either. You can also mark the attachments in a specific way (either via name or metadata) in the Forms process modeler, then have Workflow monitor for them and delete them as they come in.

0 0
replied on December 17, 2015

Oh, I wasn't saying that your requests are not totally reasonable for Forms. I'll definitely pass them on to the team.

1 0
replied on December 17, 2015

Thanks Miruna and Ege. Appreciate your help and passing this along. 

0 0
replied on July 27, 2016 Show version history

I love that we now have the option to access the row data with the attachments but if I understand this correctly, I need to use Workflow to generate the attachments into Laserfiche if I want them to have the unique data for the row they were attached to?  If that is the case then how do I turn off saving the attachments in the Save to Repository activity.  Or do I have to delete the attachments that the Forms activity creates and then go recreate those attachments via Workflow?  Seems like the Save to Repository activity in Forms could just know the corresponding row data for the table/collection the upload came from and then this entire process would be easy.

1 0
APPROVED ANSWER
replied on August 21, 2018 Show version history

This may have been answered already in another post but I was encountering the same issue the other day so I wanted to share what worked for me.

Starting with version Forms v10.2.1, you now have the ability to apply an index directly on the variable in the table and it will automatically associate metadata from the corresponding row for each attachment.

The syntax is {/dataset/Table/Column_1[Row()]}. In this example, the Table is the variable for my table and Column_1 is the variable for my field that I want to assign as metadata to my attachment. You can do this mapping entirely within forms (save to repository task) and won't need to use workflow. 

Hope this is helpful to others!

16 0
replied on August 21, 2018

That is wonderful news.  I knew we could grab the values for things like calculations but had not heard that we could use it for attachments.  This will make the process sooooo much easier than the work-around we've been having to use.

0 0
replied on July 3, 2019

Hi Alan,

Thanks for bringing this functionality to our attention! It has saved us from having to rely on workflow countless of times.

However, this doesn't seem to work when applying the index to the path? I was able to apply the [ROW()] successfully everywhere else, including the document name and its metadata. Do you foresee this in the next release?

 

 

 

0 0
replied on July 11, 2019

I'm running into the same problem, where I'm creating a path as a hidden variable on each line of a table, and trying to get the attachments in that row of the table to use that path, but when I try to use that path variable (with or without the [Row()] modifier), Forms ends up storing all documents in one folder with subfolders named ";" between the subfolders named what I wanted them to be named; like the path thought it was supposed to be "\subfolder1\;\subfolder1\;\subfolder2\;\etc."

It's starting to look like I'll have to store them in one location with an extra field that contains their calculated path variable, and have a workflow move them afterwards. It's more steps than I wanted it to be, but I've got to do what I've got to do.

0 0
replied on December 14, 2015

We currently use Workflow to iterate through Forms tables and collections and assign each item/row's metadata to attachments in it. It would be really nice if Forms could do it.

0 0
replied on December 14, 2015

The only issue with that is that there is not a guarantee that we are assigning the correct metadata to the correct attachment. 

There is not a unique identifier to show the attachment matches with its row's data. 

0 0
replied on December 14, 2015

The way we deal with that is by automatically capturing the name of the uploaded attachment in a hidden field on the same row/collection. Then workflow uses that to match each attachment with the correct row/collection metadata.

$(document.body).on('DOMNodeInserted', '#q33 .files', function(e) {
    if ($(e.target).is('tr')) {
      $('#q37 input').val($(this).find('.ellipsis').attr('title'));
    }
});

In this case, #q33 is the id of the file upload field, and #q37 is the id of the attachment name field. You can easily re-purpose this for a table or collection though.

0 0
replied on December 14, 2015

Hi there,

Thanks for your use case. We'll look into adding feature to support this use case.

0 0
replied on December 14, 2015

Abby, it would be great if Forms had support for dropdown fields in the repository as well as multi-value fields. It would make implementations so much easier. Thank you for considering!

0 0
replied on December 16, 2015 Show version history

Abby, 

Hasn't this been a feature that has been requested before? I was hoping this feature would have been added by now in the latest version. 

0 0
replied on December 16, 2015

Is there any work around for this that Laserfiche has found? 

You are not allowed to follow up in this post.

Sign in to reply to this post.