Forum Academy Marketplace Showcase Pricing Features

Option Set within a Repeating Group

Hi all, I included a Dropdown (OptionSet) in a RepeatingGroup.
I’d like the user to rate every main course by choosing from the dropdown (good/average/poor), and submit their choices at once by clicking on submit button.

So , supposedly, each dropdown in each row should have different ‘current options’, but it doesn’t work that way, and when I design my workflow, I couldn’t even find “current option” in the workflow workpanel.

Please help and thanks in advance,





If you’re intent on having a single submit button (rather than using autobinding on each thing in the RG), in my opinion, the simplest way to do this is by creating a custom state list of texts, that gives reference to each Thing in the RG along with its Rating…

Then you can use a single workflow to create the reviews based on that custom state list…

e.g.

Create a custom state somewhere (anywhere outside of the RG) which is a list of texts.

Any time the dropdown’s value changes, add a text to that list that contains a reference to the current cell’s Thing (unique ID), and the Display of the Option Set Rating… for example:
00128272615526328x00192877273633:Average

You need to make sure the list only contains 1 entry for each thing in the RG, so you’ll also need to remove any existing entries that contain the current cell’s Thing, before adding the new one (as you can’t update texts in a list of texts).

Then, when the submit button is clicked, just iterate over that list of texts (preferably in a backend workflow) to create a new review for each item in the list - containing the RG Things (from the unique ID), the Rating (from the Display of the Rating), and the User.

Alternatively, there are some plugins available that let you access data inside a RG from outside it but personally, for something as simple as this, I’d find them more complicated than using a simple custom state list as outlined above.

Hello Adam @adamhholmes

After yesterday’s conversation in another email, I finally made it 80% work by using Custom States.

However, it only gives me 3 reviews, leaving the 4th out again.

I’m attaching some screenshots here for you to see

![8|690x488](upload://7x


EkIHzycspHGzWovkt7vlreOJ0.jpeg)

Is it again about the Choice Source ? And how to fix it ?

Thank you again!

W-O

Without knowing exactly what you’re doing, or seeing inside your app I can’t really say…

So if you want to make your editor publicly viewable, I’ll take a look inside (but presumably you’re setting the custom state list incorrectly)

Hello @adamhholmes I just changed the app setting, can you try again to see if you can view the editor?

Thanks !

Yeah I can see it now…

So, there are a few things you’re doing wrong here…

Firstly, you database isn’t set up in a way that relates reviews to menus at all… so I don’t know how you’re planning to know what review is for what menu etc? You’ll want to redesign your database before you go much further, as the way it is now isn’t really going to work… (I’d also avoid using too many Text fields, and use actual datatypes instead)…

Regarding your workflows…

Currently all your doing is adding the dropdown value’s Option to a custom state list any time the value changes…

But a list can’t contain duplicate items, so your custom state list will only ever contain a maximum of 3 items (as that’s how many options there are in your option set)…

Also, you’ve got no way to relate each rating (Option) in the custom state list to a menu item, so how will you know which rating is for which item?

As I explained in my previous 2 posts (and the example I made), your custom state list must be of type text, and you’ll need to construct each text in a way that links the Rating to the Menu item, and also not allow duplicate entries on the list (otherwise how will you know which one to use?)…

I showed how I would do it in the demo I created, so study that to get the general idea, and then apply the same method to your own app.

2 Likes

Hello @adamhholmes , I’m studying the demo you created…

Did I just touched anywhere to break it ? Because now it doesn’t creating a full set of reviews when I click on “Submit” button.

I can’t replicate that issue (it’s working as expected for me)… but if it’s not working it’s probably timing out in your browser because I’m using a front end loop (2 custom events) to create the reviews (which isn’t recommended)…

In a real app (that’s not on the Free plan) you should do that on the backend…

I’ve added some additional workflow conditions that should fix that…

…but, in any case that’s not relevant here… how you create the reviews is up to you (I did it on the front end because it’s a demo app on the free plan)… but the main point of the demo is to show how to get the data out of the RG in a way that ensures each ‘Rating’ refers to a specific Meal Course…

Once you’ve got that data (in your custom state list) you can do with it what you want - I’d recommend running a recursive backend workflow to create and modify the Reviews…

1 Like

thank you @adamhholmes , much appreciated your kind help .