function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Harry MoeungHarry Moeung 

Adding Record Variable to Record Collection - Flow

Hello Devs,

I'm new to Flow and having issues assigning adding a Record (Single) Variable type to a Record Collection variable. The logical order is:

1. An Apex Action is kicked off, returning a data type of Apex-Defined Data Type list
2. A Loop is kicked off iterating through the list of the Apex-Defined Data Type
3. Assign a Record Data Type the attributes of the Apex-Defined Data Type
4. Add the Record into a Record Collection varible.

The issue that I am having is that it looks like nothing is being added into the Record Collection. The debug results I get reads as: 

ASSIGNMENT: Assign_to_Record_Collection
{!oanda_exchange_rate_record_collection} Add {!oanda_exchange_rate_record}
Result
{!oanda_exchange_rate_record_collection} = "[OandaExchangeRate__c (No ID)]"


Please see screenshots below for context.

Loop ScreenshotUser-added image
Loop Element Configuration
User-added image

Assign to Record Configuration
User-added image


Assign to Record Collection Configuration

User-added image

Assign to Record Debug

User-added image

 
agrawal mukulagrawal mukul
Hi Harry,

As i can see from last debug window the collection is showing values are assigned in it.

Thanks,
Mukul
Harry MoeungHarry Moeung
Hi Mukul,

That's assigning values to a Single Record. I'm trying to take that Single Record and add it to a Record Collection. But for some reason, it does not add. Below you can see the debug results when I try to add the Record into the Collection. 

Add to Collection Debug
User-added image

Best Regards,
Harry
 
agrawal mukulagrawal mukul
Hi Harry,

Sorry for a late reply.
Not sure you are working on personal org or client dev org.


Please go through this link Working with Collections in Flow (https://salesforcetime.com/2021/05/11/working-with-collections-in-flow/) and https://help.salesforce.com/s/articleView?id=sf.flow_ref_resources_variable_populate.htm&type=5 (https://help.salesforce.com/s/articleView?id=sf.flow_ref_resources_variable_populate.htm&type=5).

User-added image

since not able to access flow wont be able to debug and find the problem.
May be above highlighted setting will help you.

Thanks,
Mukul
 
cameron howdycameron howdy
Your way of adding the Record variable to record Collection have not issue. But, I have some issue's related adding variables in collections. It gives an error. When I add northern beaches air conditioning (http://www.luxeairconditioning.com.au/) variables in Data Record Set. It occurs an error that these variables are not supported. 
agrawal mukulagrawal mukul
I think this is a problem with variable assignment, will need your flow to find out the root cause.
If you can provide flow i can try in my personal org and give you the solution.