- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 10:56 AM
With Flow Designer we are looping over records from one table and updating / creating records in another. The source table has an address split in to 5 fields (address 1, address 2, city, state, zip). We are trying to merge these together to one larger text box on the target record.
We are using a script to keep this clean and add line breaks, however referencing the fields in the script all return null?
var address1 = fd_data._2__for_each.item.address_1;
These all are null values. How do you reference record fields inside of a For Each loop? Examples below
Flow Designer
Address script example
var address1 = fd_data._2__for_each.item.address_1;
var address2 = fd_data._2__for_each.item.address_2;
var addressCity = fd_data._2__for_each.item.address_city;
var addressState = fd_data._2__for_each.item.address_state;
var addressZip = fd_data._2__for_each.item.address_zip;
var result = address1 + '\n';
if (address2 && address2.length > 0) {
result += address2 + '\n';
}
result += addressCity + '\n';
result += addressState + '\n';
result += addressZip;
return result;
This outputs all nulls to the record
Data pill example
If we merge them them using the Data Pill Picker, data populates.
This outputs data
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 10:59 AM
A minute after I posted this I realized it was case sensitive from the input JSON object that came from a REST source.
The autocompletion suggested this
fd_data._2__for_each.item.address_1;
but it needed to be this (capital A)
fd_data._2__for_each.item.Address_1;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 10:59 AM
A minute after I posted this I realized it was case sensitive from the input JSON object that came from a REST source.
The autocompletion suggested this
fd_data._2__for_each.item.address_1;
but it needed to be this (capital A)
fd_data._2__for_each.item.Address_1;