Hey Bubblers, hopefully I have something here that can be made simpler.
I have an API POST method that sends data to an API which then returns data. Cool. Not an issue.
Right now it’s currently set up in a text/RAW format, using the _*_
code to allow me to add dynamic data. Very easy!
It looks like this:
{"price":{"0":_*_priceValue1_*_, "1": _*_priceValue2_*_, "2": _*_priceValue3_*_, "3": _*_priceValue4_*_, "4": _*_priceValue5_*_, "5": _*_priceValue6_*_, "6": _*_priceValue7_*_, "7": _*_priceValue8_*_, "8": _*_priceValue9_*_, "9": _*_priceValue10_*_, "10": _*_priceValue11_*_, "11": _*_priceValue12_*_, "12": _*_priceValue13_*_, "13": _*_priceValue14_*_, "14": _*_priceValue15_*_},
As you can see, that’s a lot of data values we have to manually enter! (Both the index of the array, and then its corresponding data).
What’s even crazier is this is the process for only ONE item that we’re sending through to the API.
Well, what happens when we want to send in two items? We have to hardcode the values to be even MORE: “15”: priceValue16, “16”: priceValue17, “17”: priceValue18… all the way to 30.
Yes, it takes 15 values for each item. So, four items would be 60 hardcoded values!
My question is:
Is there ANYWAY to make this dynamic?
To clarify, we have to enter in the index of the array for each item, and then we need to add the value. For every item/value.
We have discovered the above method works and this can be done if we hardcode the values, but is there anyway to make this dynamic or is this a Bubble limitation? I can absolutely 100% provide more clarification where needed, just let me know! Thanks