Difficulty setting value to current option

I’m building a review system which mostly works with the exception of one small bug.

The whole thing is driven by 3 options sets:

  • Review category
  • Review sub-category (contains an attribute for review category linked to the above option set)
  • Review rating (just contains numbers 1-5 so I can use these in a repeating group)

The front end looks like this

RepeatingGroup Review category and RepeatingGroup Review sub-category both have data type review sub-category.

RepeatingGroup Review category is a filtered unique list of all the categories linked to sub-categories.

The icons under RepeatingGroup Review ratings are visible based on a custom state called rating which is set on the element RepeatingGroup Review sub-category. Clicking the (non repeating) group holding the icons changes this state.

The problem is when I click an icon, the rating changes for all sub-categories within the parent category. I can’t seem to access the current sub-category to add a condition. The below screenshot shows the result of when I click the 3rd star for condition sub-category under the property category.

Any pointers greatly appreciated!

trying to do what you’re trying to do with states will be quite challenging

you’d be best to just take the WU cost and change the database record on each rating change

then you could do the conditional easily.

the issue with states is that they are not meant to be used for rows within repeating groups - and you’re trying to use them with rows within rows.

the second problem is that you need to hold 2 pieces of information - the rating and which category it is for. It is entirely possible to do it with a text field and JS to send, hold and read JSON

This topic was automatically closed after 70 days. New replies are no longer allowed.