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

Question

Question

for each value of a multi-value field - query data - assign token values - email

asked on February 28, 2014

 For each value entered in a multi-value field, I need to query a database to locate the email address associated with each value, and then add all of those email addresses to the CC field of an email activity.

 

I have tried modifying an assign token activity to add the semicolon and the email address result from the query within the for each value activity.  All email addresses are still not appearing in the CC field.

 

Any suggestions?

 

Thank you!!

2 0

Answer

APPROVED ANSWER
replied on February 28, 2014

To loop through the results of a query you want to use "For Each Row" not "For Each Value".

 

This should do the trick for you:

 

1 0

Replies

replied on February 28, 2014 Show version history

I would just use assign token value to append each email address to a multivalued token. Then in the "CC:" for email do the following:

 

 

I'd also throw a track tokens in there while you're testing to make sure everything is working as expected.

0 0
replied on February 28, 2014

What if you can't add any data to your values. For example the Retrieve PDF Form Content activity is not able to edit the multi-value token it can generate. How do you get an index count or do a for each index of a multi-value token. I can't seem to find the option anywhere.

0 0
replied on February 28, 2014 Show version history

I'm not sure I understand. You can edit the value of any token using Assign Token Values to update a value.

The "For Each Value" activity will run a series of activities on all values of a multivalued token (it makes available a "current value" token to those activities inside it). This enables you to reach each value.

To get an index count on a multivalued token you can use the "Value Count" token function.

If this doesn't help maybe Start up a new question topic with your exact usecase and I'll try to help.

0 0
replied on February 28, 2014

Thank you for your quick response.  I don't think this will work for me because I don't have an email activity within the "For Each Value" activity because I'm not sending an individual email to each value. There is a multi-value field named "CDF - Branch Name."  We also have a database that contains an email address for each branch.  Here is an example:

 

BRANCH                        SUPERVISOR_EMAIL

01  - Main Office             01mainofficeoperations@fmb.com

02  - East Long Beach    02eastlongbeachoperations@fmb.com

 

So, for each value of the CDF - Branch Name field, I want workflow to perform the Query Data activity and return the email address.  I tried using an "Assign Token Values" field to modify the field value as follows, and then use that token in the CC field of various email activities in the workflow.

 

OperationsRecordsDepartment@fmb.com;%(ForEachValueDomicileBranchEmail_Current Value);

 

I'm not sure where I went wrong.  Only one email address was added to the token.  I attached an image of those activities.  Thank you so much for your help!!!

Workflow.JPG
Workflow.JPG (44.95 KB)
0 0
APPROVED ANSWER
replied on February 28, 2014

To loop through the results of a query you want to use "For Each Row" not "For Each Value".

 

This should do the trick for you:

 

1 0
replied on February 28, 2014

Unfortunately, this didn't work.  Either because I did it wrong, or it is more complex.  While ther are multiple values to be queried, the database only contains a single row for each value.  Does that make a difference?  I attached what my activities look like after incorporating your recommendations.  Thank you!

Workflow.JPG
Workflow.JPG (34.17 KB)
0 0
replied on February 28, 2014

Try moving your first Assign Token Values outside of the For Each Value

1 0
replied on February 28, 2014

It is so close to working, but I think there might be an issue with the indexing or something.  Would you mind taking a look at my Assign Token activity?  In the track tokens details, both email addresses appear in the token value; however, only the first email address is going into the email.  I attached some images.  Thank you!!!

Workflow.docx (37.09 KB)
0 0
replied on March 3, 2014

You'll want to use the indexing in the place you actually use the multivalue token, not in creating it. So instead of putting it in the Assign Token Value activity, put it in the CC field for the token produced by that activity.

1 0
replied on March 3, 2014

It works perfectly!!!  That was the final thing I needed to fix.

 

Thank you for all your help Matt!!!

0 0
replied on March 3, 2014

No problem, glad I could help.

0 0
replied on August 1, 2014 Show version history

Great thread and very helpful for a similar project we are working on.  Our routine produces a list that identifies missing documents, and e-mails it away, using a DB query and the For Each Row task.  Looks like this:

 

Please send us the following items:

 

March, 2014, C. Bank Statements, PNC #0567
March, 2014, C.Bank Statements, Chase #1111
March, 2014, D. Credit Card Statements, Chase #7159
March, 2014, E. Sales Tax, ST-50
April, 2014, C. Bank Statements, PNC #0567
April, 2014, C.Bank Statements, Chase #1111
April, 2014, D. Credit Card Statements, Chase #7159
April, 2014, E. Sales Tax, ST-50
May, 2014, C. Bank Statements, Chase #9999
May, 2014, C. Bank Statements, PNC #0567
May, 2014, D. Credit Card Statements, Chase #7159
May, 2014, E. Sales Tax, ST-50

 

Or we will nag you endlessly.  Thank you, Laserfiche Workflow

 

We used tracking as the item was indexed, and then ran a bunch of SQL.  We were concerned about the overhead of searching folders, plus needed to allow for bank accounts being added and closed over time. Workflow remains a delight every time we set something up!

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

Sign in to reply to this post.