How can I use my custom state to display in a repeating group even if I haven't saved this data yet?

I created a form and within this form I have a group that is inside a repeating group that contains some fields. The user will navigate between the groups, and at the end, will have a summary of the information about the group that was within the repeating group. I don’t want to save this data initially in my database because the user may simply not finish registering the form and I will end up with unnecessary data in my database. But how can I show users this data in a repeating group or table? Since both in the repeating group in the type of content part and in the datasource, I cannot put my custom state as datasource because there are several fields.

You can create a custom state which is a list of texts.

Say you have a form which captures the name and email. Once the user adds it, update the custom state to store the name$email$number

At the time of saving to the DB, you can split by operator (split by: $) and access the field values by specifying the number of the item (ex: item #2 means email)

and how can I showing this custom states into the repeating group or table?

Your repeating group would be of type “Text”, and reference that custom state as it’s Data Source.

This post by @artemzheg is super helpful in understanding datatypes, text, and custom states in repeating groups:

Dynamic row addition in Repeating Group and bulk CRUD of Things using vanilla Bubble Tips

yeah but when I bring the information to the repeating group it repeats as if I had recorded the same data twice. for example: I type the name test, the email teste@teste.com and when I bring this information to the repeating group it appears as if I had made 2 records of the same data. this way:
image

Can you show screenshots for how you have your repeating group structured, and the custom state?

sure. custom state to get the fields values:
image
image
tha table element to show de value from custom state:
image
image
image

I would make sure your Custom State is set to be a ‘List’, and when you click on ‘add to list’ (or whatever your button element is called), the workflow would be ‘Set Custom State’ → fretamento_candidatura’s cs_tipo (so you’re setting the custom state first with the current custom state value), Plus Item and then include the Radio & input values with the arbitrary text as you have above. This will add that text as a new value at the end of the current custom state list (and you could include a delete button which just removes that text, for example). And then in your Table, your data is set to the custom state, and in the first text field, your source should be ‘Current Cell’s Text’ Split By $ Item # 1. and then follow suit for Item #2.

This topic was automatically closed after 70 days. New replies are no longer allowed.