Forum Academy Marketplace Showcase Pricing Features

Content of repeating group cells inside a custom state

Hello,

I created a custom state of type text, with multiple values. It’s supposed to be like an array of text.

I want to fill it with the values of a given cell of a repeating group.
To be more specific, my repeating group has 3 cells :

  • the first one contains a firstname
  • the second cell contains a lastname
  • and the last one contains full name (concat of 2 previous cells)

I want to get the full names inside the custom state.
How can I do that ?

Thanks for your help.

Can you explain full use case? Why you need to store the value in custom state?

1 Like

I want to store it into a custom state because I need to retrieve it and then use it in a PDF document that is generated.
When I try to pass the values of the cells into the document, I only can access to the repeating group values and not the cells. And I’m not able to concat anything. That’s why I was thinking of doing this way.

Is it clearer for you now ?

@bonjourbenny I just want to get some clarity here, do you have first and and last names saved in separate fields and in an attempt to export them together you are concatenating them in a RG?

Hello @AlexE ,

Yes, in my database the two are stored in separate fields.
I’m using PDF conjurer plugin to generate a PDF file.
Inside this pdf I have to display the content of the repeating group that’s on my page, so what PDF conjurer let me do is : select repeating group and choose the thing I want to display, so basically I can choose User’s firstname, or User’s lastname, but I can’t choose User’s fullname because I don’t have that field in the database.

So I thought maybe I could use a custom state to store the list of full names, and loop on it instead of looping on repeating group content.

When I’m inside PDF conjurer, I can see that I can select custom states to loop on so that could work.

But I don’t know how to put the full names inside my custom state.
Could you please help me ?

I was able to create such lists but it was triggered by the user click : I had a repeating group containing checkboxes icons and when the user clicks on an itme, it adds or removes the item inside the custom state list. But in this case, the custom state list has to get generated without user clicking…

@bonjourbenny I haven’t dealt with creating PDF’s and unfortunately I’m not sure of a way to accomplish what you’re doing. I know there’s a plugin called listshifter which can perform several operations on lists, browser side, including iteration and possibly even concatenation which seem to be two things you need. Maybe you can play around with that plugin a bit and see if you can figure it out. There should be a decent amount of info on it in these forums.

My bigger question is why aren’t you saving the user’s full name as a field in the database? I think it’s a good practice if you’re expecting to use this value. It’s something that can be done easily now, even if you already have a ton of users. And it’s also easy to maintain going forward. Let me know what you think.

Thanks for your help @AlexE.
For now I must admit I don’t know what to do… I don’t want to install too many plugins on the app.
On the other hand, saving the full name in the db would be much more easier, you’re right, but as a developer, this is something i NEVER do :slight_smile: and it’s a bit painful for me to do this.
I’m in 2 minds about what to do…
I’ll take some time to think of it and come back once I made my decision.
Have a great day !

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