Is there a way to have application variables? For example, I’d like to put the name of the application or the company in a global variable and reference that variable in many places throughout the app. One idea I had was to create a collection called “App Settings” and put stuff like that in there, but not sure how I’d reference a particular row in that collection that would hold a value. Thanks, guys!
Just create a property in the users app.
Eg - Let’s say I add a property called “App Name”
Then in the sign-up form, I will add “App Name” as an automatic field to maybe set it’s value to “Food App”.
Now whenever a user signs up, for every user the value of the property “App Name” will be “Food App”.
Now you can user it dynamically anywhere in the app.
I appreciate the reply and the idea. I didn’t think of that. Thanks!
One concern I have is, what if I want to change the setting? If I have 100 users, how do I instantly change the value for all 100 users all at once?
It’s simple even then.
Create another app with the same database.
In that app, create screen 1 and screen 2.
Screen 1 will have a button called “Change Value of X property”
Now link this button to screen 2.
On screen 2, drag and drop a countdown component. Make its timer to 2 seconds.
Now make this single component a list.
This will be a list of Users.
Now select the countdown component inside the list and go to the section, “action after countdown ends”
Here click on “Add another Action”. Then select Update Current User.
Here put the “New Value” in the “App Name” property.
In this way, when you run this new app once on your device. The value of that property will be changed for all users.
I know its a difficult to understand.
You can watch @ErikG video on creating multiple records on one button.
@Erik could you link your video here please
Check this out.
For temporary variables requiring data manipulation, I use logged in user, which means adding property to users collection, and it can grow rapidly depending how much you want to check things.
For temporary variable during certain screen, I use hidden input field that act as switch to tell it yes or no with change input value, it is useful to make a loading lottie file, something like that.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.