Repeat in server action doesn't work

Hi! I'm having problems with the repeat on this server action; it's not receiving the values ​​from the input array ($_GET.semana)

The Payload is: semana [{"dia_semana":0,"hora_inicio":"00:00","hora_fin":"00:00","allday":"S"}]

Any idea?

Can you try adding set value steps inside the repeat and assigns the value to them? Then enable output for the set values and see the results in your browser, under Dev Tools > Network XHR?

Hello Teodor! I tried that, and the values are null, but the repeat is executed a lot of times.

In the App Connect I use a Data Store (ds_schedule) for the week, and the input parameter semana for the Server Connect is:

ds_schedule.data.map('{dia_semana: dia_semana, hora_inicio: start, hora_fin: end, allday: allday}').toJSON()

Is ok that?

Can you try outputting the $_GET.semana in a set value step?
Also how do you pass a value to the get variable and what expression is used exactly?

The expression is:

ds_schedule.data.map('{dia_semana: dia_semana, hora_inicio: start, hora_fin: end, allday: allday}').toJSON()

and the output of $_GET.semana is:

"week": "[{"dia_semana":2,"hora_inicio":"02:00","hora_fin":"03:00"},{"dia_semana":3,"hora_inicio":"00:00","hora_fin":"00:00","allday":"S"}]",

Is the expression correct? Because in the server connection it appears to be text and not an array.

Try adding .parseJSON() in the end of the $_GET.semanaexpression

Great! It works! Thanks a lot!
Where is it documented that?

Unfortunately that’s not documented as the parseJSON formatter is not available in the UI.

1 Like

There’s a feature request for it to be added:

It seems strange that it hasn’t been.

Now, in reverse, how do I save the output values ​​of a server connect in a data store?