Usually we want USERSETTINGS() to stay present on the device.
But in my case I would like to reset one Usersetting each time the App restarts.
One part of the Usersettings is: “How many days do you want to display in the App?”. The user can choose a number. But I want this number to reset to 10 each time the App restarts.
Is that possible?
@Fabian
The most possible solution might be:
I believe you can set an AppFormula in your USERSETTINGS like:
IFS(
LOOKUP("ID001","LAST_SYNC","ID","LAST_SYNCED") < NOW(),10,
TRUE,[_THIS]
)
There is no way to differentiate an app (re)start and a sync.
Thank you very much @LeventK and @Steve. Your input helped me to find a solution that’s fitting for me.
I created a hidden USERSETTINGS column called “Today” with the initial value TODAY() and Reset on Edit.
In the Security Filter I used the expression:
IFS(
USERSETTINGS("Today") = TODAY() , DATE([DateTime]) > TODAY() - USERSETTINGS(Days) ,
USERSETTINGS("Today") <> TODAY() , DATE([DateTime]) > TODAY() - 10
)
This means: The Days in the USERSETTINGS are valid only today. Tomorrow it will load 10 days.
I hope this works
Note that the value of your Today user setting will only be updated if the user visits the user settings form and saves the form.
Yes that’s okay for me.
User | Count |
---|---|
37 | |
25 | |
21 | |
20 | |
16 |