Prevent duplicate inputs from being saved in an RG (using Orchestra)

I have a repeating group with an input element where users can specify a ‘cost’ (type: number) and save those into a database:

Very simply - I want to prevent ‘Save Keepers’ from kicking off the workflow (see below) if there are more than one instance of the same input (i.e. ‘4’ appears twice in the screenshot).

Here is the workflow below - it uses the Orchestra plugin to ‘change a thing’ in each row of the database. I’ve tried multiple solutions including using custom states… but nothing seems to work. Any help would be much appreciated!

cc @ZeroqodeSupport in case you’ve run into this before.

1 Like

You probably need to split your workflow in two.

  1. Trigger the musicians under the pertinent maestro to each add their value to the same list in a custom state somewhere.
  2. When that maestro finishes, compare the count of items in the custom state’s list to the count of rows in the repeating group. The counts will match if each item in the list is unique since the musician actions to add to the list2. won’t duplicate an existing value. If the counts don’t match, don’t save the values.
1 Like

Hello @jmoney, :wave:

Thank you for sharing the screenshots and details about your setup. We haven’t encountered this specific issue before, so we would need a bit more information to assist you better. Could you please provide more details on the following:

  1. What exactly is not working as expected? Are there any error messages, or is the workflow simply not executing as you intend?
  2. Have you already tried implementing any custom states or conditions to check for duplicate input values? If so, could you describe what you have attempted so far?
  3. Are you using any specific plugins or custom code apart from the Orchestra plugin to handle the validation or workflow execution?

Looking forward to your reply.

Best regards,
Zeroqode Support Team.

Thanks all for your comments. I am trying to set a state as per @davidb 's suggestion first, but I’m unable to find the input element (“Input Keeper Cost”)

Here is the picture of the Element tree:
Screenshot 2024-07-02 at 12.53.40 PM

Interestingly when I move the element outside of the Repeating Group it appears, but obviously I need it within. Any ideas or thoughts would be appreciated!

Hi @jmoney, :wave:

Thank you for your message. You might try grouping the input element with another element and then accessing the group instead of the individual input element. Sometimes accessing groups can be more straightforward than accessing individual elements within a repeating group.

We hope this helps!

Best regards,
Zeroqode Support Team.

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