I have a repeat on $resources in a table.
the myid, mytext and myreference, dependant on the endpoint may be completely different titles, but I will always want to bind client side what is returned in those 3 property paths (values 3-5)
And then you access the elements based on their index instead of name, e.g.:
keys[2] // "myid"
values[2] // 1
Indexes start counting from 0, so it’s 2-4 instead of 3-5
You can run that example in your browser’s dev console just to play with it. When you’re ready you can search on the forums how to access Wappler variables from regular Javascript code. Maybe you could make a Javascript code to create those properties you always know the name getting the values from their indexes, and in your table you bind to the property name you create. Though this sort of thing is probably dealt better directly in the server action, to rename those properties to something you always know the name (though I don’t know how to do that on top of my head), so your table always binds to the properties you know the names
You can try checking if Wappler has a formatter equivalent to Object.keys and Object.values to get an array from an object
Sorry if this whole text sounds confusing, I don’t have much time but just wanted to let you know about these possibilities
Thanks @Apple, appreciate your help.
Does anyone know if/how I can do this server side with a repeat of the resources and outputting just the
required Object.keys[2] [3] etc
Can you try to do a Set Value with that inside the Repeat of $resources? I think you have to use the $value (of the Repeat) variable and apply the Keys or Values method on that variable
Thank you @Apple
So I set a repeat on $resources and collection values api.data.$resources.values()
Then set values within the repeat $value.values()[4], $value.values()[5] etc