0

I'm trying to create a survey form using screen flow and for that I'm fetching the Question records from Question custom object and trying to show Questions as text along with their options as radio in screen for each question record. Please see the below screenshot

Survey Flow Survey Flow Get Records detail Get Records

Loop Detail Loop Detail

Screen Element detail Question Screen

But when i run this flow then loop only shows the first record and skips for rest items in Question list (Created 2 dummy records for Question), Please see the below screenshot

Flow Output Questionnaire Modal

Flow Debug Output Get Record Output If I try to build above survey form in LWC/Aura then i can easily iterate the list variable over same kind of markup and show the each Question record with their options but unable to do so in the screen flow.

I have also searched regarding my query and found that it is feasible in the Flow using text collection variable to store the Question record and show the same in Screen at the end of the loop. But that solution is not working for my use case.

Issue with Loop and display of list Using Salesforce flow

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A91bKSAR

Any help or suggestion will save my day.

8
  • 1
    Please edit your question to show how the Get Records works. Are you sure this is keeping all the records in the flow variable, not just the first one?
    – Phil W
    Commented Dec 28, 2022 at 8:20
  • @PhilW i have edited my question and attach the screenshot , please see the output for Get Records.
    – kunal
    Commented Dec 28, 2022 at 12:49
  • Does the flow run in user or system mode, and with or without sharing? The fact you see two IDs in the debug output is useful to know. That suggests the loop should iterate. I think we need the loop element and screen element details to be added to the question too. Sorry.
    – Phil W
    Commented Dec 28, 2022 at 13:02
  • @PhilW it is running in System mode which is without sharing context and i think above flow screenshot is already providing the loop and screen elements details. If you are expecting some other details please let me know. <br/> Instead of fetching the records from question object, if we will create the collection variable and iterate over the same screen element then I'm sure it will run for first item only. Will do it and share the output here
    – kunal
    Commented Dec 28, 2022 at 13:40
  • 1
    I am sure there must be some clear reason for this behaviour. But without full detail of the entire flow it is hard to know.
    – Phil W
    Commented Dec 28, 2022 at 13:54

0

You must log in to answer this question.