The CreatorCon Call for Content is officially open! Get started here.

Flow Designer - REST API - Data Structure

Ken Pruitt
Tera Expert

Hello Community,

I'm working in Flow Designer. My trigger is REST API - Asynchronous. I have built a test data structure for the body of the API call just to ensure it works as I expect it to. However, after building the example data structure, I cannot access the data pills of the data structure in other parts of the flow.

Example Data Structure

find_real_file.png

 

When I go to another step in the flow and try to access those attributes from record, they are not available. Why? (i already included a ForEach loop)

find_real_file.png

2 REPLIES 2

Ravi Peddineni
Kilo Sage

@Ken Pruitt 

records object contains multiple records. You have to loop that variable through for loop using Flow Logic > For loop action. Then you will get access to those records.

Ken83
Mega Guru

For anyone else that may run into this issue, here is how I navigated it...

1) In the trigger of the REST API, you must configure the data structure of the payload in the way you expect to receive it to your instance. The flow will only utilize the properties you've configured so if you don't see it in your logging/testing, make sure you've defined all of the properties in the trigger. 

find_real_file.png

 

2) You will need a For Each loop in the flow to iterate through each record in the payload that you receive. I had this part in place already(Step 2) but I still couldn't access the individual properties of the payload i was receiving. I had to create a new Action (Step 3 - Parse User Payload) to spit out an Object that I could use in the rest of the flow. The only input it requires is the payload from the loop.

find_real_file.png

 

find_real_file.png

 

In the Action, i'm simply checking to ensure the payload has attributes. This tells me if I received an empty payload. Then I used the error evaluation to account for this.

find_real_file.png

 

Assuming everything is in place, you *must define an Object output that matches the data structure of the **individual record** from your trigger at the beginning of the flow*. This structure should look like what you expect each individual record in the payload to look like.

find_real_file.png

 

Once you do that, make sure you map the values into your output object appropriately otherwise you will be missing values on the output object and will only have access to whatever is configured here.

find_real_file.png

 

Enjoy!