When i select value from this dropdown i want to store refrence id in the Database which is if Pending is selected in database 1 should be stored continue with the rest of the values… how to do this can anyone help??
I have tried this method but it only works for single time any other way??
hanan1
2
it is much easier to make a status option set with a ‘preview’ attribute, this way you can simply make it dropdown status's value's preview instead of trying to define it while you create a thing or use conditionals.
Hey @manan.modi! You want to save a specific reference ID to your database based on the selected value from the dropdown.
Here’s a step-by-step solution:
Step 1: Create an Option Set (recommended for managing dropdown values and IDs)
-
Go to Data > Option sets.
-
Create a new Option Set, for example, Status.
-
Add attributes to this Option Set:
Display (text): This will hold the status name, like “Pending,” “Completed,” etc.
Reference ID (number): This will hold the ID you want to store in the database, like 1 for “Pending,” 2 for “Completed,” etc.
- Under your new Option Set, create options for each status (e.g., Pending, Completed, Picked). For each option, assign a unique Reference ID.
Step 2: Update Your Dropdown
-
Set your dropdown’s Type of Choices to the new Option Set you created (e.g., Status).
-
Set Choices Source to All Status (or whatever you named the Option Set).
-
For the Option Caption, select the Display attribute to show “Pending,” “Completed,” etc., as dropdown options.
Step 3: Store the Reference ID in the Database
-
Create a new workflow for when the dropdown’s value is changed.
-
Add an action to this workflow that creates or updates a record in your database.
-
In the field where you want to store the reference ID, set it to Dropdown Status’s value’s Reference ID.
Example Workflow
-
Trigger: When Dropdown’s value is changed.
-
Action: Create a new entry (or Make changes to a thing in the database).
-
Set the field (e.g., P_id) to Dropdown Status’s value’s Reference ID.
Why This Works
Using Option Sets keeps your values and reference IDs organized and makes it easy to add, remove, or update options later. When you select an option in the dropdown, Bubble will directly access the Reference ID attribute without needing additional “Find and Replace” logic.
Let me know if this helps, or if you need any more details!
@livingperson800 Thank you so much for giving this information
1 Like
system
Closed
5
This topic was automatically closed after 70 days. New replies are no longer allowed.