How can I add data to a repeating group without creating/changing a thing in the database?

Hello!

I am creating an app for managing new orders that will later become production entries.

Right now, the user can click on the button NEW ORDER, which shows a pop up that the user must fill with the required information. One of the sections in the pop up is the order details, in which I have created a group with a repeating group and a search bar.

The issue I am facing is that I do not know how to populate the repeating group from the found option in the search bar without creating/changing a thing in the database, as when I create the ORDER this will be the new thing created.

NEW ORDER BUTTON:
image

POP UP:

SEARCH AND RG WITH ADD BUTTON:

Do you have any recommendations for how to manage this?

Thank you in advance

Hi there,

I would recommend creating a custom state on the page of whatever datatype you’re using in the RepeatingGroup, set to List. Now change your RepeatingGroup’s data source to the page’s custom state.

Create a workflow that when the button is clicked to add an item to the order, you’ll Set the Custom State to add this item to the state.

Hello!

Thank you very much!! I could apply your solution and now I can search through the search bar and populate the repeating group.

Now, I am facing another issue. How does the text inside the repeating group be configured for it to only show one option that I have previously added from the search bar options?

SEARCHING THROUGH THE SEARCH BAR:
image

ADDING THE OPTIONS:

As you can see, when I select one and add one, the whole set of options populate the RG, and I need only the one I have added.

Also, I need for the app to let me add more that one to the list, will this be possible with a RG?

Thank you very much!

It looks like your workflow is set to load the entire list into the State. You should instead set it to be: "This page’s custom state’s list of things Plus Searchbox’s Value’ with each part of that expression modified to the correct elements and how you have them named.

Hello!

Thank you for your help. I am still struggling with this issue. I have tried to set the state once the ADD button is clicked, but I do not know how to manage only one option in the repeating group.

Here I have added only one time this product:
image

And I need for this to allow to add more products from the search bar and ADD button.

This is how I have structured the Set State workflow that begins with the ADD button:


I understand that in this step is where I should set it to be: “This page’s custom state’s list of things Plus Searchbox’s Value”, but the first part is unavailable in the options.

Thank you in advance

Can you set the state on page load, even to empty state?

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