Convert List of Text (in custom state) to database

Hi guys,

I have a group with a searchbox looking for products name.
The group has quantity, price and total price. When the use click in (+ADD ITEM), the inputs go to a multiline input text where I use regex to show in the repeating group showing the list of texts in a custom state.

In this example I have the following list of texts:
text -1: -Produto1-[000001] <10> :100: {1000}
text - 2:-Produto2-[000002] <20> :150: {3000}

When the user click in “SAVE PURCHASE ORDER” I need to send this data the database (like product´s name = Produto1, quantity = 10, unity price=100 and total price=1000).

How can I do that?
Thanks!!

Hi

The current text uses various symbols such as “-” and “<>”, so I think it would be better to unify all symbols with comma ( , ).

For example, product name, quantity, unit price, total price, etc.
text -1: Produto1, 000001, 10, 100, 1000

After that, I think it would be a good idea to separate the comma-separated text with split(), specify the first line if you want to get the product name, and the second line if you want to get the quantity, and save it in the database.

Also, if you want to save numbers, you have to convert number.

I hope it’s helpful to you.

Thanks for your reply.
I´m using different symbols to extract the text extracting with REGEX.
This way I know when to show just the Product Name, Price and so on in the Repeating Group.