I have been having fun with Bubble so far but i have blocker. I’ve tried to look in forums but nothing helped, when it did before on other issues.
I am trying to create a value for a user, based on a choice the user picked in a drop down. Here is how it looks:
User picks either passport or ID card
I can record this choice in the database. No issue there. However, i also want to set another static value for this user, depending on what they picked.
I am trying to achieve: When user has picked “ID card”, set “PA” for the column “DE Pers doc type” in the database. I tried this workflow in the Back end:
However, it doesn’t seem to agree with my approach and no data is recorded for “DE Pers doc type” for that user. Can’t i set a static value here? How can i create a rule in the database based on data saved prior?
Hope this was explained clearly enough. Any help is muchos appreciated.
There is a much easier way to do this using option sets:
- Create a new option set called something like Document Types.
- Add an attribute called something like “DEPers”.
- Add your 2 options (Passport and ID card) and then add the attribute for DEPers.
- Then go back to your dropdown and make the choices pull from your fancy new option set.
- Then you can easily change the first workflow to set the 2 fields in the user data type, where the second field will be Document Type’s DEPers.
Thanks for the answer and the suggestion. It worked. I don’t think it would be very practical if there were more options., because the “Only when” field would require a lot of conditions (or a lot of workflows for each option i suppose.)
Would an API workflow do the trick too?
You don’t need the “only when”. You just need to use the option set’s attributes and you can have as many as you want.
I must have done something wrong then, because it recorded all options in the set for that user (“RP, PA”)
Here is how it’s configured:
Options & attributes:
It did exactly what you told it to do “All Document Types’s DEPersDoc”.
Change that to the dropdown’s value DEPersDoc.
Of course. I am not used to 2 level expressions, when it comes to input fields. Thanks a lot.