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
Ross McLeod 3Ross McLeod 3 

Subflow Record Variable Input

Hi

I'm fairly new to flow development but I'm trying to be a bit efficient when it comes to building them keeping in mind the governor limits. So what I wanted to do was build a master flow which runs when an object is saved which runs various subflows. What I want to do in the master is select the record and pass that off to the subflows which will alter the data and then pass it back out and set a "Data Changed" variable so the master know if it has to save the record. 

Problem seems to be that although I have selected the record out in the master I don't seem to be able to pass that to the input variable on my subflow.

This is my Master Flow

Master Flow
Candidate Record Variable
Candidate Record Variable


Sub Flow
Subflow


The Email action was put in so that I could check that the record selected had been populated when I ran / debugged the flow. Which it was. 

I think the issue is because the Candidate Record input variable is not being set but I'm not sure why.

Anyone that has any ideas would be a life saver.

Thanks
Best Answer chosen by Ross McLeod 3
Abdul KhatriAbdul Khatri
Hi Ross,

First of all I see you are running this flow as Auto Launched, possibly from Process Builder and hopefully sending the Id from there.

With I guess Spring 20, Salesforce has provided to run the flow on SObject Triggers, which has been greatly enhanced in Winter 21, you can leverage that and remove the layer of Process builder
https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_forcecom_flow_fbuilder_new_flow_window_start.htm

You can run the flow directly on Candidate SObject on Update and little simplify the flow. In that case you don't need to get records and your concern of Id not getting set will automatically remove.

Let me know if this helps
 

All Answers

Abdul KhatriAbdul Khatri
Hi Ross,

First of all I see you are running this flow as Auto Launched, possibly from Process Builder and hopefully sending the Id from there.

With I guess Spring 20, Salesforce has provided to run the flow on SObject Triggers, which has been greatly enhanced in Winter 21, you can leverage that and remove the layer of Process builder
https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_forcecom_flow_fbuilder_new_flow_window_start.htm

You can run the flow directly on Candidate SObject on Update and little simplify the flow. In that case you don't need to get records and your concern of Id not getting set will automatically remove.

Let me know if this helps
 
This was selected as the best answer
Ross McLeod 3Ross McLeod 3
Hi

Thanks for your swift response. I did look at the new flows but I wasn't able to call sub-flows from them or if you can I couldn't work out how to do it. 

Yes I am running from Process buiilder which passes the recordId in to the Master Flow. This all works fine the bit that I'm having issues with is passing a populated record variable into the subflow. As you can see from the diagram it sees that there is an input variable available on the sub-flow but I don't seem to be able to set this with the variable from my master flow.

Any idea?

Thanks
Abdul KhatriAbdul Khatri
You need to turn ON that Don't Include and then set Input Variable from the variable recordId from the parent flow

User-added image

 
Abdul KhatriAbdul Khatri
Hi Ross

The solution worked
Ross McLeod 3Ross McLeod 3
Hi

Yes sorry for the delayed reply. Worked perfectly. I now feel like a right idiot for not working that out. My only defence is that in my head the toggle was saying "Turn on" to not include the property :-)

Many thanks

Ross