I have server connect app to linked to this simple server action.
I add "multi checkbox form group", type "checkbox group". on an element "Checkbox Control" I did "Dynamic attributes - repeat" and selected this server connect "zcity.json" query. On checkbox input I selected "dynamic attributes - input - name" and selected this vertical form group repeat - checkbox control - city.
I selected "Form label" "Dynamic attributes - display - inner text" and selected this vertical form group repeat - checkbox control - city.
In the result I'm getting only the first city or the city with city_id: 1.
Code looks like this:
I've tried everything and it coes not work, when I change the code manually instead of "zcity_filter_input1_group.repeat4[0].city" and "zcity_filter_input1_group.repeat4[0].city" to "city" it starts working.
Quick Explanation of Wappler's Logic/Approach/Philosophy:
When working with arrays, repeats, or collections in Wappler, it's essential to reference the object or key inside the array/repeat/collection rather than the entire array.
In the example you provided: zcity_filter_input1_group.repeat4[0].city
This points to the first record in the array (arrays are zero-indexed) and outputs the value of the city key.
However, what you need to do is select the entire repeat element: zcity_filter_input1_group.repeat4
Then, you can output specific keys, like city, from the repeated data.
Sometimes, Wappler may mistakenly interpret your intention and output the entire array instead of just the desired element.
@franse@Notum thank you, I managed to get it to work, but did lots of manual work, wather I do not know wappler this good or it has serious buggs. I manualy set the values to "city", instead of selecting from the UI (because it does not work properly). also the checkboxes does not contain values even when corrected to "city" manualy. So I set it manual again:
is wappler works that way or it's completely bugged in using repeats?