Conditionally Set DB Value

Does anyone know how to implement and IF ELSE type logic to set a value in a collection?

My ideal use case would be to generate a random number using the “RAND(1,10)” function and then use an IF statement which sets the value of a property in my collection to either A (if 5 or lower) or B (if 6 or higher).

However, I cannot find a way to set the value of a property using a condition nor can I find a way to randomly set values other than numbers or dates (even used the Randomiser component)

Thanks in advance

I made a quick video to demonstrate this for you.

Amazing @Colin, absolutely brilliant, thank you!! It was the conditional on the “Update record” which I couldn’t seem to figure out.

In the interim, I came up with a workaround and used the number output from Rand(1,2) to store in the DB, set a 1 or a 2 against each photo in my deck swiper and then filtered the deck based on this number. Not ideal but does the job. I’m just posting in case it helps anyone else. I’m going to implement your method though. Thanks again.

1 Like