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

Question

Question

Laserfiche Cloud - Email formatting

asked on January 15

Does anyone have any advice on formatting the emails from either Laserfiche forms or Workflow to include data from a table within Laserfiche Forms?

For example in forms I have a table that has fields such as the below: 

Location:                                           Comments:   

The user can add multiple locations and multiple comments. 

I would like to include the Location and Comment in the email notification that they user receives from forms. I would like to keep the relevant comment with the relevant location (maintain the rows)

I have tried several formatting options and the values appear like this displaying all the locations, then all the comments:

Location 1; Location 2; Comment 1; Comment 2        

I have tried to use workflow to Index the values and use a line break then enter the values into a table but 1 the table doesn't display and 2 I think because of the line break the comments don't appear and it displays like this: 

Location 1

Location 2 

Has anyone had any similar issues/experience and managed to overcome it in Cloud?

0 0

Replies

replied on February 10

If I'm reading this right, you want a workflow that formats the Locations and Comments as they are seen in the form.  I managed to get something simple working with a helper workflow function.  Set the inputs to be multivalued Location and Comments.  Make sure you check "Allow this workflow to be started by other processes".  This allows forms to call the process.  Now, create a single valued output called "Formatted Comments".  This is where I store the string I'll send to the email activity:

Here's my input/output parameters:

I'm only using two activities for this; for each value and assign token.  For each value iterates through each location so add this to the for each values:

For the Assign Token activity, set the output token (Formatted Comments) to be like the following:

This starts with the existing value for the Formatted Comments followed by the current for each loop value.  Finally, add the multivalue comments data but index it to the current loop iteration (right click on a token to add indexing):

Finally, follow it all up with a "<br>" or a html line break.

Publish the workflow so you can use it in forms.

Add a field to your form called "Formatted Comments".  Save the form so that it adds the variable.  You can now delete the "Formatted Comments" field and the variable will stay with the form. This may sound weird but it's the only way I know to create form variables that aren't on a form and we will need this later.

In your business process, add a Workflow Service Task and Email Service Task:

The workflow service task config should look something like this:

Here, we just add the table variables to the Location and Comments inputs.  Select "Wait for the invoked workflow to be finished..." so that you can add outputs.  For the output, set the "Formatted Comments Text" to the variable we created earlier.

In the Email Service Task properties, set the body of the email to contain the "Formatted_Comments" variable and that should pretty much do it. 

My result looks like this:

You could get more elaborate and build a html table into the string but this should get things going in the right direction.

1 0
replied on January 17

Hi Sarah,

I'd recommend asking this question in the main Answers area where way more people will be able to see it. Only SPs can see posts made in this group.

0 0
replied on January 21

Thanks Samuel, I have changed this to share with the entire site now.

1 0
replied on January 21

At this point I'd probably delete this and re-ask the question as it's a few pages back now and won't be seen by many.

0 0
replied on February 10

Hi Sarah,

Did you figure out a solution for this? Trying to do something similar, but not sure how to pass the multi-value tokens to Workflow in a way that I can loop through them the way I usually do in an on-prem system.

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

Sign in to reply to this post.