How Can I Make a Sentence Using Data of Repeating Group?

Hi, Bubblers. :cowboy_hat_face:

Does anyone can solve this?

I have set main data ‘Basket’ and ‘Basket Items’ like below.


I wanted Basket Items to be shown in a Repeating Group like Basket Item Title(Quantity) like below

Item1(1), item2(1), item3(3), item4(2), item5(1)

Not like item1, item2, item3, item4, item5, 1,1,3,2,1

So I set Repeating Groups like below with help.



Then Basket Items appear like this form

Item1(1), item2(1), item3(3), item4(2), item5(1)

Then, I wanted to create a sentence using the list of items of Repeating Group like this.

‘Hi!, You ordered ‘1 item1, 2 item2, 3 item3, 2 item4, and 1 item5’. Thank you!’

I tried like below but it didn’t work.

It shows like this: ‘Hi, You ordered item1, item2, item3, item4, item5, 1, 1, 3, 2, 1, Thank you!’

I want it to be shown like: Item1(1), item2(1), item3(3), item4(2), item5(1)

How can I make it happen?

Thank you for reading!

I’m pretty sure you cannot do it using any kind of display of the RG’s output.

I’m not sure this will work, but give this a try:
Add a custom state to the page called something like orderTexts. Make the custom state of type text and make it a list.
Then add a workflow that whenever the user adds an order item, add a workflow that adds the “Quantity Item Title” to the custom state orderTexts.
Then you should be able to just include custom state orderTexts in your text display.

1 Like

Hi, @SerPounce
Thank you for your article.

I tried all day to follow your suggestion.
It works for adding multiple ‘Basket Items’ by Custom state.
But when an user change(increase or decrease) quantity it is hard to find specific basket item’s quantity .

And make the text still in from '1, item 1, 1, item 2, 2, item 3.

Ah, right. That does make things quite complicated. But it might be doable by using the item# within the custom state list. Have you tried this?

1 Like

Hi @SerPounce
Can we store item#, item title, and quantity at once using Custom State?
and pull out one of items then increase or decrease the quantity of the item when an user clicks either up- arrow button or down-arrow button?

I think there must be a simple solution. Because it is very basic function that a lot of people need to use in order to deal with their data in real.
Right?

It is like just printing out, in a text box, a list of basket items(its title and quantity together, not separately) which stored in Basket (which contains the basket items).

But I cannot find… I will do more to find.
Thank you for trying to help me @SerPounce

Hey @universe1 happy to help although SerPounce is much more experienced that me so I’m not sure I’ll be of any further help. I can give this is a try tomorrow though and I’ll let you know

2 Likes

@ambroisedlg, you’re far too kind. Thank you.

1 Like

ok @universe1, after @ambroisedlg’s high praise, I had to pull something out the bag.

Check out:

To see it in action, click “New Basket”, add a few items, change them after adding and then click “Make Sentence”.
Ask questions if you need clarification on how this is working.

This is the result.

2 Likes

Beautifully done kudos to you @SerPounce :ok_hand:

2 Likes

Wow! Wow! Wow! @SerPounce
This is an another level !!
The workflow is so beautiful!
It seems like you created an art genre!

Thank you for sharing your art piece from your bag! :+1:

So glad it worked out. Happy I could help.

1 Like

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