How do I generate list state on page-load based on data field, then allow save-able state changes?

Here’s the situation -
A manager loads a page with a RG list of staff, which corresponds to a data type ‘staff’. There is a field in that data type called ‘opt-in’ currently set as text so that it can allow three values - Yes / No / Undecided (undecided is important so I’m not using a Yes/No data type).

The ultimate goal is to display an icon in the RG that indicates the Opt-in status, as either a green check (Yes), red x (No), or black circle (Undec.). However, I’d like the manager to be able to click the icon to cycle through these options to change the status - then click a save button on the page to write that updated status back to the table.

My thought is, I can load the existing Opt-in values from the data table as a page list, then use that list to drive the display of the icons; but then allow interactions with the icons to change the list state which can ultimately be written back to the table. Is that a good way to do it? Is there a better way? If this is a decent way to go about it, where I’m struggling is how to set up the list and have it pull the data from the table in order to establish the beginning states for these icons.

Any help would be appreciated - or if you know of a video tutorial that covers this, a link would be great! Thanks!

This setup would make it on the fly instead of hitting save at the end:

  1. Create an option set with the three opt-in statuses, then under your Staff datatype add a new field with the datatype of your new option set (call it Status?).
  2. Put all three of your icons in the repeating group cell, uncheck visible on page load, and check collapse when hidden for all three.
  3. Add conditional to each one so for your green checkmark, your conditional would be “Current cell’s Staff’s Status is Yes” then make the element visible.
  4. Repeat for each icon but make one No and one Undecided.
  5. Then make the workflow for the Yes button will be: Make changes to a thing, Current cell's Staff then change the Status field to No
  6. Repeating this for the No button so it sets it to Undecided, then repeating again for Undecided to set it to Yes.

If you want it to not make any changes right away, and instead have save button let me think about that one

1 Like

Thanks, that absolutely worked! Since there is not a ton of data traffic for this site, I think writing the updates as the icons are clicked is perfectly fine. This is a huge help - thanks again!

1 Like