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
Luca FumarolaLuca Fumarola 

How to use Get Records correctly in flow

I would like to add a custmized action in the page layout of the order summary, this action has to trigger a specific flow that I'm trying to building.
User-added image
The creation of the action was simple enougth to be done also for me!
The problem is related with the flow, specifically I need to use the get records element to get the order Number (or the order ID ) of the current order summary.
How can I access data of the current object that I've selected this from flow?
Best Answer chosen by Luca Fumarola
Sai PraveenSai Praveen (Salesforce Developers) 
Hi luca,

You have to define a variable called recordId in the flow and select allow input which gives the recordid of the record from which the flow is called.

Now you can use getrecord to query with that id and get the field you required.

Please find the below article which shows how to create that variable.
https://help.salesforce.com/s/articleView?id=sf.omnichannel_create_recordid.htm&type=5 (https://help.salesforce.com/s/articleView?id=sf.omnichannel_create_recordid.htm&type=5)


Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi luca,

You have to define a variable called recordId in the flow and select allow input which gives the recordid of the record from which the flow is called.

Now you can use getrecord to query with that id and get the field you required.

Please find the below article which shows how to create that variable.
https://help.salesforce.com/s/articleView?id=sf.omnichannel_create_recordid.htm&type=5 (https://help.salesforce.com/s/articleView?id=sf.omnichannel_create_recordid.htm&type=5)


Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
This was selected as the best answer
TEJESWARI TEJUTEJESWARI TEJU
Hi Luca
When you add a Get Records element to a screen flow or an autolaunched flow, we automatically store all the record values in a flow variable. When the flow moves to the next element, the values are assigned to the variable..
If it's useful.
Pls choose as a best answer
From Tejeswari