Goal
I created a survey form and i want a point when users successfully fill the form, they should receive free random code . I have the random codes in an excel sheet and I am using webhook to listen to the form submission.
I have successfully created and implemented a functioning form. The associated webhook has been configured to retrieve submitted data from the form. To ensure the uniqueness of the codes distributed, I have used the “Search Rows” module. Although my understanding of this module was uncertain, I have used it to search for existing rows and prevent duplicate codes from being assigned to users.
you could update a new column in your sheet that says wether the code is sent out already or not and for your new search module you filter only for the ones that have not been sent. that way you prevent sending duplicate codes
Instead of pre-generating all the codes upfront, why not generate the code at the point of form submission, then check the spreadsheet if it has already been used, and if not, record it in the spreadsheet?
I used ABCDEFGHJKMNPQRSTUVWXYZ23456789!@#$%^& repeated 4 times to allow for repeated characters in the code, and to make it way less likely that a duplicate is generated. You can have more times but there are diminishing returns
I removed ambiguous characters 1ILO0
I used a triple shuffle - you could add more shuffles to randomise the array more but there are diminishing returns
I used substring 0;6, but you can change the 6 to however long you want your output to be
B. Use UUID
If you use UUID, you are guaranteed to never have a duplicate code
Then, you can reduce your scenario to only four modules
Very clever use of split(), shuffle() and join() to randomize a string by splitting a seed string into an array, randomizing the array and then reassembling it using join() with the emptystring as the delimiter. Well done!