- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 09:40 AM
I am very new to all of this. I want to use a flow to send email that has information from a number of database records. Currently I have a Look Up Records action and then a For Each action that sends an email based on some data in each record. So, this might send 10 emails. I don't really want to send the email until I have read a number of records (based on a condition -- maybe a value of 0 in a given field. So, what should I do in my For Each action instead of sending mail? Do I have some kind of a script that writes to a variable and then use the variable when I want to send mail? What is the best way to accomplish this? Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2023 09:06 AM
OK - I have figured this out. The correct line for the script is:
return fd_data.flow_var.issuetext += fd_data._2__for_each.item.issue + ';'
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 09:01 AM
Under the Flow Logic actions there is a "Set Flow Variables" step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 11:39 AM
Yes, that's helps. But I still have 2 issues. The test run is attached.
1. When I test, I see this: For Each Item in 1 - Look Up Records->SurveyDetail Records 1 of 1. There are actually 7 records in the table. And it looks like my code only does things for 1 record. Why is that?
2. Assuming I can get the above issue working, how can I concatenate the variable values from record to record? It looks like all I can do is set the variable, so even if I look at all the records, I would think I would only get the last issue.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 12:11 PM
I got rid of my first issue -- I had a condition hanging around so it only looked up 1 record. But I still don't yet know how to solve the second issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 01:45 PM
You should be able to achieve this with inline scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2023 10:16 AM
Well, I am still having 2 issues.
Issue 1: It doesn't seem like the For Each is iterating through all 6 records, though it indicates that it does. From the execution, it looks like it's only doing one record, and it only looks like it's logging one record. And it doesn't seem like the same record. In the run, it says Set Flow Variables 1 and Log 1. I thought it would do it 6 times.
Issue 2: In the Set Flow Variables step, I do: return fd_data.flow_var.issue += the value from the pill, which is For Each > SurveyDetailRecord > Issue. Same for issueText. For the body of the email, I use Flow Variables > IssueType and Flow Variables > IssueText. But my email body comes out:
return fd_data.flow_var.issueType += Medium
return fd_data.flow_var.issue += Power
Not sure what is going on. Doc file attached.
Thanks