Insert different RAND() to every row

I have automation taking and inserting =RAND() to a table column, however the same random number gets inserted for the whole column. I'd like it to vary per row. I've tried tinkering with =THISROW() but that doesn't seem to step the function.

Any ideas?

Hi @R-b580 welcome to the community! :wave:

From what you are describing, it sounds like what would resolve this for you is leveraging the 'Run the step for these rows' run option

Here is a screenshot of my 'Sample_Table' where I want to insert a random number for any row in column2 that is blank.
Screenshot 2020-11-24 163927

In my app I created a button with an 'overwrite' automation and then specified this in the 'Run the step for these rows'


What this is saying is that for any row where 'Column2' is blank it will run this automation.

Then I specified to take date from =RAND() and write to =Sample_Table[Column2]

As a result what will happen on a button click is that the automation will look at each row that matches my run option and then individually for each row will take =RAND() and write to my column named 'Column2'. This leads to each row receiving it's own random number.
Screenshot 2020-11-24 165309

Hope this helps! Let us know if you have any further questions :slight_smile:

Happy Building! :hammer_and_wrench:

Many thanks Matt, that works.

Just for completeness, I was trying to do this from standalone automation, just return =TRUE() for the matching, which was giving the result, I've mentioned. The likely reason - I was using "Update or Insert" instead of "Overwrite".

(apologies can only embed one picture, hopefully I've attached the most relevant)

1 Like

Thanks for circling back here @R-b580 , glad to hear that it works now!

If you have any further questions, let us know. The community is here to support you :grinning:

Happy Building :hammer_and_wrench: