Is it possible to refresh RAND() function using Glide action?
If you change a value anywhere in the spreadsheet (eg. with a Set Column Values action), it should force a recalculation.
Have you considered the Roll Dice plugin as an alternative, or do you actually need a random value in the Google Sheet?
Tnx! I need CHANGING random for every return to the list of kids letter exercises. This can be done with recalculation of RAND() function in Googlesheet, works perfectly. RollDice is fix, can’t be recalculated?
But with RAND() I have a problem if I add new record in the app: how can I propagate RAND() function in Googlesheet column?
I tried to make the same in Glide internal spreadsheet column, random numbers are ok, but there is no recalculating with SetColumnValues action!?
The Dice Roll column accepts a seed value. If you use the current time as a seed, you will get a value that changes every 10 seconds.
If you’re just wanting to shuffle a list, then another option might be the Reshuffle action?
Option you suggested is not “another” option, tis is simplest and most efficient option. I was not aware of it, tnx a lot!
Now I tested the GlideAI for that, it answers perfectly:
To display a randomly ordered list every time you display it in Glide, you can use the “Reshuffle” action.
"Here are the steps to do this:
- In your Google Sheet, create a column with the items you want to display in your list.
- In Glide, create a new screen and add a List component.
- In the List component, select the column with your items as the “Source”.
- Under “Layout / Options”, select “Random” as the “Sort” option.
- Add a Button or Image component to your screen.
- Add an Action to the Button or Image component.
- In the Action, select “Reshuffle” as the Action type.
- Select the List component as the “Target”.
- Save the Action and test it in your app.
This will allow you to display a randomly ordered list every time you display it in your app. When the user clicks the Button or Image component, the Reshuffle action will be triggered and the list will be randomly reordered.
Here is a link to the Glide documentation on the Reshuffle action: Glide • Reshuffle
I hope this helps! Let me know if you have any further questions."
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.