Toggles default to on

Hi Team,

Is there any way to default a toggle to be “on”? eg I have an “Allow Push Notifications”? which I want a user to be able to edit obviously but I want to default it to already be ticked. Is this possible?

thanks!

Hi @robrea,

Toggle is “On” when the associated boolean (True/False) property is set to True.

So you could set this property to True upon record creation, and then have the toggle turned “On”.

However, this may not be related to “Request Notification Permission”. I assume this action should be explicitly called from the app, and user must consciously agree to receive the notifications.

Best regards, Victor.

I am so sorry, but I don’t understand this at all?

Hi @robrea,

Toggle is linked to some property in some collection.
See the screenshot.

If this property is set to “True”, toggle will be “On”.
If this property is set to “False”, toggle will be “Off”.

Best,
Victor

Hi again,
Sorry I’ve been trying to get my head around this and think I know what the issue is!! Although I don’t know how to fix it!!

Victor, the screen on your post is explicitly for the toggle feature… What I’m trying to figure out is true/false properties working within a form. So, as part of user collection I have a “Push Notifications” option (which is a true/false property) and when adding this to a form feature the toggling doesn’t work, the entry within the database does not update with the ticking of this “toggle” and every time of go to the screen which shows this option within the app it is toggled as off. So what I need is for the button/toggle/(true/false) element to update the database.

Hopefully that makes sense!

Any help would be most appreciated.

Hi @robrea,

Just created a sample test form, for users collection, added a boolean property for this collection, and checked the functionality - all works for me.

So I’d advice to check:

  • Are you sure you’ve set up the form correctly?
  • Did you choose the action “update logged-in user” for the form?
  • Do you have an action set for “submit” button on the form?
  • Just in case, are you changing this boolean property somewhere else (for example, action on screen enter)?

Best,
Victor

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.