Values inside array

I have a variable inside a repeat but only the last value remains. How can I get them all?

Hi, you seriously need to work on these posts.
There is no context to your question.

What repeat are you talking about here - client or server side?
What do you want to do with the variable?

Sorry, I’m afraid to write something wrong in English. I will start over to describe the problem.

In the server side the system receive a post with some informations with attribute and his value and transforme to another format with name and value. I’m use “repeat” struture to read all values and rewrites the values. This array have two attributes, but just the last I can include in set value.

For example, In the client side the user post :

attributes[0][rg]: value1
attributes[1][cpf]: value2

In the server side I need to post to Rest server

{
"name": "rg"
 "value": "value1"
}
{
"name": "cpf"
 "value": "value1"
}

My repeat is :

wappler4

It’s works, but the result array have just one last value.

This looks like the same issue you have been posting.
When you use a variable inside repeat, you can use it in two ways:

  1. Use the repeat itself, as it will have the array of items.
    Instead of creating one, you need to create two set value steps - one with name as “name” and other with name “value”
  2. Declare a variable before repeat step, and inside repeat concat value to the same variable.

Just keep the outputs on experiment with various things. What you are trying to acheive is not very difficult.

Thanks, I managed to do it, but I can’t convert the string to json. Is there any function I can use?

Where do I insert this?

Please read the discussion on link. There’s nothing to insert anywhere.
Its just a formatter… To be used like others.

I’m sorry I tried using server side and it doesn’t work.
I must have misunderstood something.

How I can use .parseJSON() in server connect, I’m I tried to use it and it doesn’t work.

For example :
In set value ‘test’ I’m use value with -> “name”:“cpf”,“value”:“123456”, “name”:“rg”,“value”:“123456”

I’m try to use test.parseJSON() but doesn’t work.

I can use another method to change ?

Add another set value step and set the value in that as test.parseJSON().

Thanks for your help

I tried to use it as you said, but unfortunately it doesn’t work. Is there another way to do it?

wappler1202

What doesn’t work? test2 is not showing JSON as its value?
Also, if you just need to set in cookie, you can also just store the stringified JSON.

Thank you very much for your help, thanks to her I managed to make a dynamic form in the frontend and send it REST to the server. If anyone has any similar needs I can help too.