Please Help me filter out duplicate entries of text in a repeating group

Hello,

What one would think should be a fairly easy task yet I have been struggling with this for the past two days, if anyone could point me in the right direction would be a god send as I am pulling out my hair trying to figure this one out. Here is a quick loom video showing how my page functions, I will also inlclude a link to a seperate app that I setup and can share accesss too.

Basically I have a repeating group and its list size is determined by the number the user enters into the “Quantity” input. I then have a seperate input inside of my repeating group where the user can enter in the corresponding serial numbers depending on how many of said item he has.

I would like to take my “List of Texts” and filter out any duplication so that I can perform validation on these fields and display a notice that says “You have a matching serial number”, I can not perform this search on the database because the serial numbers for this item have not yet been saved to the database.

I have used the plugin RepeatingGroup Tools and am able to generate a list of all my input value’s including duplicates. I would like to filter this list to only show me texts that appear more than once. If a text does appear more then once and the input value inside my RG is contained in this list of texts. With this I could then apply the red border and some text that notifies them of a duplicate.

I feel like I am very close, I will include a demo application that you can edit, unfortunatley it does not have the plugin which generates the list as shown in my video as its a paid plugin.

Any help is greatly appreciated

Thanks!

Hey I clicked the link to your editor and set up workflows for setting custom states when an inputs value is changed. Then I added a conditional to change the bottom border of an input that has the same value as another

Upon testing it looks like you have figured it out. I will look into how you did this but thank you so much!

1 Like

Yea just when an inputs value is changed either the custom state contains the inputs value or it doesn’t. If it does, then it will add the current cell’s index to a list of invalid indexes. If it doesn’t then it will add its value to the custom state we are checking against then it will remove it’s index from the list of invalid indexes if it happens to be in there. The conditional on the inputs checks for if its current cell index is in the list of invalid indexes and if it is then it gives the input a red bottom border.

One more question for you, I made the app everyone can edit again if you would be kind enough to show me…

Your solution works well however it retains the value of the input in the serial custom state even if that value was changed. This results in an error if the user erases a previous value and uses it in a seperate input then this input will show as invalid. I tried coming up with a condition myself to minus the item from the serial custom state but cant quite get it.

Thanks in advance.

I will check it next time I’m on but that is a good point. We would need to be able to say if input at list item one was changed then remove its previous value from the custom state. From first thought maybe we can make it a data type instead of a custom state so we can store the current cells index and the text value. I will look at it Friday at the earliest but if you want to try and implement that method then I believe it would work.

I’m pretty sure I got it working. I didn’t delete the workflows using the custom states in case you wanted to try and find another way of doing it but I made it to when the page loads all temporary sku are deleted and then as the inputs values are changed their is a temporary sku created for each cell. Then there are rules for making their valid yes or no. Then each input has a conditional for if its temporary sku is valid or not.

I have managed to get it fully working using a completley different method that uses no custom states or workflows. Let me show you what I did,

I am using BDK Repeating Group Tools plugin to generate a list of text values from the inputs as seen below

I then used the if-else plugin to geneate a true or false value if my inputs value is not empty and appears in the list more than once.

I then added a condition on my input that says if false make the border red.

This produces the following results as seen in the following loom video:
https://www.loom.com/share/81615f0f297f4838b8085bc15ba3f2e2

1 Like

Hey I know you already solved this but I just really felt like making a plug in to solve this as well and this way I can get feedback from users on more rules to validate an input. If this may cut down on your workflows you can use it. It is on the marketplace for free. All you have to do is add a conditional to the inputs and use the Update Inputs action in the input change workflow.
Here is the example:

Here is the editor:

1 Like

This is great, thank you and very nice work!

Looks really good, my only reccomendation would be to just modify the conditional to not match empty fields against one another. Currently if two inputs value’s are cleared they will match against one another.

Would be fine to have it not validate if it was empty only but not if it matches another empty input. See my image below to see what I mean
image

1 Like

Thanks. Fixed.

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