Hello all!
I am working on a survey that pulls in a JSON array and I want to make a repeat for each item in the array. I have found how to make the correct number of repeats, but I am unable to figure out how to tell which repeat I am on. I would like to know this so that I could put that number into the 'calculate' field to prepopulate fields within the repeats.
If anyone knows if this is possible, please let me know! Thank you! 🙂
Chris
Solved! Go to Solution.
I do not know your function but my guess is you wrapped the whole thing in quotes so it is just a string.
"features[${rpos}].elt"
You prob want something like "features[" + string(${rpos}) + "].elt"
Hard to tell.
position(..) is the way to do it now. If you have nested repeats use position(${nameofrepeat})
Thanks Doug!
I can get the current repeat number using the 'position(..)' method. But, unfortunately, it does not seem to translate to the 'pulldata' function that I am using to get the JSON.
The Pole Number field is dynamically trying to pull from the JSON by what repeat it is on. The Pole Description is just static at the 1st element in the JSON array. I would like both to be dynamic.
Thanks!
I do not know your function but my guess is you wrapped the whole thing in quotes so it is just a string.
"features[${rpos}].elt"
You prob want something like "features[" + string(${rpos}) + "].elt"
Hard to tell.
Thanks! That did the trick!
Much Appreciated!
Chris
Just in case: Old habit to use + I should have mentioned that if you are going to use the web form at all + will not work and you must use concat() instead. I only use the apps so I forget. Sorry.