USERSETTINGS() reset on start

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?

0 5 1,072
5 REPLIES 5

@Fabian
The most possible solution might be:

  • Add a new table with only one column and 2 rows including the header. Column type is text and in row2 you can enter whatever you like i.e. ID001. Name the sheet i.e. LAST_SYNC and give a header name i.e. ID
  • Import this table to the app and in column structure, add a VC with NOW() expression and name it as you like i.e. LAST_SYNCED.

I believe you can set an AppFormula in your USERSETTINGS like:

IFS(
	LOOKUP("ID001","LAST_SYNC","ID","LAST_SYNCED") < NOW(),10,
	TRUE,[_THIS]
)

Steve
Platinum 4
Platinum 4

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.

Top Labels in this Space