Populate a choice component with user data?

Wondering if this is possible:
Screen 1: User enters their city and state
Screen 2: User is shown a choice component with the following four options:
• Northeast
• Hudson Valley
• {state they entered}
• (city they entered}

Seems like there must be a way to do this - I just can’t figure it out…

Scratch the below, I didn’t read properly. Let me think a bit and I’ll give you a better answer.

Yes, certainly possible. How you do it mostly depends on how you’re navigating from the first screen to the second screen. What does the user do to get from the first screen to the second? Presumably they tap a button - what is the action on that button?

If, for example, the City/State selections are being written to User Specific Columns, and the action is Show New Screen->This Item, then the values that they entered should be there in the current row and available to use.

Okay, so a choice component requires all values to be in a single column that spans multiple rows. But the two values that you’re collecting (City/State) will be written to separate columns on the same row. So what you will need to do is essentially transpose those and tag them on the end of your other choices (Northeast/Hudson Valley). So you’ll need something like this:

  • Create a helper table with enough rows to cater for the maximum number of choices
  • Add a Lookup column that directly targets the column that contains your list of static choices
  • In the table where your screen 1 choices are written, use a Makearray column to join the two columns into an array. Add that column to your helper table using a relation + lookup or single value column
  • Now (back in the helper table) use another Make Array column to combine the previous two columns. This will give you an array of all 4 choices (2 static, 2 dynamic)
  • The final step is to transpose the array. Do that as follows:
    – Add a RowID to the helper table
    – Add a Lookup column that targets the RowID column
    – Add a Find Array Index column that looks for the RowID in the array of RowID’s (this will give you an incrementing Index number for each row)
    – Use a Single Value column to extract the Nth item from the combined Make Array column, where N is the Row Index

The end result is that you should have all 4 options in a single column, and you can use that as the source of your choice component on the 2nd screen.

4 Likes

Thank you so much for the quick and clear response, Darren.
This got me the result I wanted - and helped me understand some new functionality along the way.
Much appreciated!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.