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 

Flow - Action Output Record Collection Variable

Hello Devs,

I am having trouble getting an Output Value from a Flow Action. Whenever I call the action in Flow, it returns as 'Outputs:
{!oanda_exchange_rate} = oandaExchangeRateList ([OandaExchangeRate__c (No ID)])'. I'm not sure what "No ID" means so I can't really debug that. Eventually I want to insert this data into the database. Below are the steps of what I am doing:

1. Input data into the Action Element via Invocable Variables
2. The inputted data pings an API and returns some a JSON that is transformed into an object type and creates multiple objects
3. The objects are saved into a Output Invocable Variable for use in Flow.
4. I save that list of objects into a Record Collection Variable in Flow
5. I run the debugger and I see "Outputs:
{!oanda_exchange_rate} = oandaExchangeRateList ([OandaExchangeRate__c (No ID)])'" as the output.

Not sure where I am going wrong here.

Flow Resource Configuration

Flow Resource Configuration

Action Configration

Action Configuration


Outputs Values After Debugging
Outputs Value

Sample Data of Output Being Passed Into Flow
(methodOutputs:[oandaExchangeRateList=(OandaExchangeRate__c:{Base_Currency__c=EUR, Quote_Currency__c=EUR, Average_Exchange_Rate__c=1.000000, Id=null})])

 
Deepika GulatiDeepika Gulati
Hi Harry 

In the apex action, did you insert the records. Could you check the mapping of wrapper values to object field values and ID has been mapped correctly. 
Could you please paste the apex action code here if possible. 

Regards
Deepika
Harry MoeungHarry Moeung
I found another way to pass the list data back to Flow. Instead of to passing a list of objects to a record type from Apex to Flow, I returned an Apex-Defined Data Type by creating a class. And instead of returning the data using InvocableVariables, I used the return value of the Invocable Method by returning a List of List of the Apex-Defined Data Type.