How to fetch lookup fields on flow datatable in Salesforce Flows.
Think before you get the solution, this is what one of my colleague(Hans) said to me. Since I am in a complete programming mind set, could not check well what is provided in the configurations of a screen flow.
But if you think slowly and relate every single line and variable assignments of a program, you can do the same thing in flow.
Step1 : Fetching records
Using Get Records, you can fetch all the records (as you all were aware).
Step 2: Looping the records ( the main task)
Step 2.1 : After creating the loop, create a Variable resource ( remember not a collection). It should be the same as the collection record type (i.e..., the records object for what you fetched in the Step 1)
Lets name the variable as "individual_variable" in this example.
Step 2.2 : In the looping, Use the individual_variable in the loop and Assign the current Item that is looping.
Step 2.3 : Click on Add assignment button. There select the Lookup object's field Id from the "individual_variable" and in the value select the Name field of "Current Item from loop"
Step 2.4 : For every variable you want to show it on the data table you assign it to the "individual_variable"
Step 2.5 : Create a New Resource, of the same object type and this time it will be the collection.
"Allows multiple values" For Example we can name it as (collection_after_iteration)
Step 2.6 : Add the "individual_variable" to the collection we just created.
Step 3 : Pass the collection (collection_after_iteration) to the data table.
That's all folks, it will be bit tricky to think, but the credit of explaining this to me goes to The Master Johannes (Hans). There is a need to correct some blogs and documentations
No comments:
Post a Comment