Skip to main content
Gorav Seth asked in #Flow
I've got an Sobject collection variable in a flow, and I would like to display a list of values from the collection in a display text field.

If I use the varaible resource, it displays the IDs, along the lines of [Id1, Id2, Id3].

Is there any way to get the flow to produce something along the lines of:

Name1, Value1

Name2, Value2,

Name3, Value3,

in a display text field?

If not possible in the flow itself, I'm guessing if I embed the flow in a visualforce page I could pull it off, but would appreciate any tips on going about that.

Thanks

(Cross post from success: https://success.salesforce.com/answers?id=90630000000Cr4J)
89 answers
  1. Jan 29, 2015, 8:04 PM

    The trick here is getting the other non-Id values out of the sObject Collection, and to do that, you'll need a loop. Where it gets really hairy is getting it laid out correctly. I haven't built this yet, it's entirely theoretical, but here's what I would attempt.

    • First, make a new variable (we'll call it varDisplayText) to hold all of your text.
    • Then, in your loop, pass the Collection to a standard sObject Variable.
    • From there, use an Assignment element to Add (not equals!) the first value of the first column to varDisplayText.
    • Then (and I think you can do this in the same Assignment element, I am pretty sure it will do it in order), use varDisplayText again but instead of using Equals, use Add, and add the text string ", ".
    • Add another line in the same element (or a new Assignment element if necessary), use varDisplayText again, with Add, then the first value in your second column.
    • Add another line in the same element (or a new Assignment element if necessary), use varDisplayText again, with Add, then the comma text string again, but with a line break character afterwards.
    • Point back to your loop so you can get the next set of values in your collection.

    When the flow runs, it should do the Assignment with the add, which functions as concatenation, for each row, creating a different row of text.

    I am REALLY not certain this would work, but it's what I would try; it works on paper. Otherwise, I think you're limited to a VF page here.
0/9000