• Harry Moeung
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
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

 
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})])

 
Hello Devs,

I am getting a
'System.NullPointerException: Attempt to de-reference a null object' error when attempting to add values to a list of an object. I am not quite sure what is causing this error but I don't believe I'm passing a null value into the list. I need to add items to the oandaExchangeRateList invocable variable so I can pass that into an Apex Flow.


//This is the wrapper class. Rmoved a lot of code for readability.
public with sharing class OandaExchangeRatesCalloutsWrapperV1 {

public class methodOutputs{
        @InvocableVariable
        public List<OandaExchangeRate__c> oandaExchangeRateList;
    }
}


//This is the debug code that gives me the Null Pointer Exception Error
OandaExchangeRate__c oandaExchangeRate = new OandaExchangeRate__c();

oandaExchangeRate.Base_Currency__c = 'USD';
oandaExchangeRate.Quote_Currency__c = 'USD';
oandaExchangeRate.Average_Exchange_Rate__c = 1.0;

OandaExchangeRatesCalloutsWrapperV1.methodOutputs wrapper = new OandaExchangeRatesCalloutsWrapperV1.methodOutputs();
wrapper.oandaExchangeRateList.add(oandaExchangeRate);


 
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

 
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})])

 
Hello Devs,

I am getting a
'System.NullPointerException: Attempt to de-reference a null object' error when attempting to add values to a list of an object. I am not quite sure what is causing this error but I don't believe I'm passing a null value into the list. I need to add items to the oandaExchangeRateList invocable variable so I can pass that into an Apex Flow.


//This is the wrapper class. Rmoved a lot of code for readability.
public with sharing class OandaExchangeRatesCalloutsWrapperV1 {

public class methodOutputs{
        @InvocableVariable
        public List<OandaExchangeRate__c> oandaExchangeRateList;
    }
}


//This is the debug code that gives me the Null Pointer Exception Error
OandaExchangeRate__c oandaExchangeRate = new OandaExchangeRate__c();

oandaExchangeRate.Base_Currency__c = 'USD';
oandaExchangeRate.Quote_Currency__c = 'USD';
oandaExchangeRate.Average_Exchange_Rate__c = 1.0;

OandaExchangeRatesCalloutsWrapperV1.methodOutputs wrapper = new OandaExchangeRatesCalloutsWrapperV1.methodOutputs();
wrapper.oandaExchangeRateList.add(oandaExchangeRate);