I’m building a form for a user to be allowed to changed his settings in the database, how do I disable the other input fields on passing empty values if not filled out so it doesn’t make the users data empty in the database?
Hi @alexelkhoury i assume you mean here something like edit mode for user profile. The easiest way is to do a save workflow which makes a change to current user. Then you add all inputs / dropdowns whatever you have for user in that workflow. The last part is to set all that inputs intial value to existing value from database so when user click edit button or whatever you have there inputs will be automatically filled up.
The last thing you need to make sure is to set parent element of that inputs to date type of user so when user presses “edit” you fire another workflow that fills inputs parent element with data of current user.
Cheers!
Hi,
One way of doing this is by holding the values in custom state that are populated when the user opens the form. Then you can change value of state if any input changes. On submit, save values from state into database. This won’t change add any blank values.
Also, if you pre-populate the users settings on form load, it will be saved as is, if no changes are made to certain inputs.
Hope this helps.
Regards,
Anil
You just beat me to that
Hehehe