Forms - Dynamic CheckBoxs with Dynamic Fields based on Option Set

Hi everyone,
I am creating an app for generating documents (contracts, declarion forms, etc).
You need to select Buyer - Seller - Required Docs - Click Generate.

The templates need to be dynamic as there are over 50 different templates, and it would be a pain to maintain if done manually.

All the document types are defined as Option Set and all required fields are defind as a separate option set and assigned to the template Option Set.

I am having issues saving it to the database. can someone help?

I am defining a custom state - plu item for every selected checkbox as a new template.
When the generate button is clicked I save that state to the a new created item.
My issue is I cannot find a way to save the text from the required input fields.

I tried adding that in the selected template custom state, but I cannot get it to work.
I tried creating a separeta state, but cannot figure it out either.

Any ideea? Am i doing it the right way?
Please check here a demo project of this:

You can not create or modify or delete options sets dynamically, they must be done inside the app editor manually.

As suggested in another post, you could consider exploring how form builder templates have been built by other Bubblers in the Bubble template marketplace.

As @boston85719 mentioned, option sets are meant for many uses but not to be created as entries. Entries are created using data types.

Also, you could consider getting an official Bubble coach to assist you. Just Google “Bubble.io coaches” and choose the official Bubble list of coaches in the domain bubble.io.

Best of luck with your project! :+1:t2:

I am not trying to edit the option set. I am using the option set to save the template name, and the field name. I need to store the field value as a data type as you said under generate doc data type or under a standalone datatype.

What exactly is not working? (from the editor link you shared it seems to be working fine).

Edit - the input values are being saved ok, which was the issue you said you were having in your original post, so I assume you’ve fixed that now.

1 Like

The selected templates are beeing saved. The data that the user types inside the input boxes for each template is not saving.

I guess I have two options:

  • create a data type field input and save each field in association with template and doc generation ID. This would create a very big data base, and I would prefer the data to be inside the generation.

  • create a field inside the document template that somehow saves the data there…

Still reaserching, I haven’t found a good answer yet.

Ah, you mean the Req Field Name 1 & Req Field Name 1 inputs? These relate to attributes on one of your option sets by the looks of it

As @boston85719 said above, you can’t save values to option sets in workflows, they have to be set in the editor.

So whatever data you’re trying to save it will have to be saved in the database.

the option set is just generating the name of the input Req Field Name 1, Req Field Name 2, etc.

I add an input next to it, to save the desired user value. Example:

Template Contract → Require Field Name: PRICE: User input 3000$, I need a way to save the Price - 3000$ to the database

maybe I should generate the REQ Fields some other way?

Where are you trying to save the input values to?

I was trying to somehow create a data type field and custom state for it. Every time the user completes to plus item field answer. And when clicking generate docs, save the data inside generate docs fields. i couldnt find a way to do that.

NOw i am creating a data set field in asociation with generation and try to save data there…

what is your opininon ? how would you do that? how would you create that in the database?

I have the solution.

  1. I use option set to display all templates

  2. I use option set to display all reuqired fields for each template

  3. When user selects a template – > I add a custom state of type optione set - templates and plus item the selected template

  4. When user comples a required field:
    4.1. I automatically create a data set Fields with:
    - Name: Option Set - Fields - current cell
    - Template: Option Set = template name (for this i have another custom state to transfer the selected template at the fields repeating group level)
    - Input Value: User entered value
    4.2 Add created Field to a Custom State containing all created Fields

  5. When I generate the documents i save to it:

    • list of selected templates from the custom state
    • list of created required fields from the custom state

Let me know if any questions

If somone can come up with an ideea on how to save the input data to a custom state and create it when clicking the generate button, I would apreaciate the input. happy to send a coffee :slightly_smiling_face: