I need to set a parameter for a variable:
business_hours_schedule
Below is the JSON format of how business_hours_schedule is structured (I’ve included an image right below it to give a visual of how the indentation is). I need to set the objects “day” and “times” within “schedule”
You mean duplicate values or duplicate keys itself?
Duplicate keys are not allowed in JSON itself as I understand. Or even if it might be allowed, it might be considering the value under latest key or something like that.
Okay, like this. These are not duplicate keys really. They are keys in different elements of array.
Here if you want multiple elements in array and have same keys in them, I think you have two options:
If number of elements in your documents array is constant (say 2, as you have shown here) then you can name the dynamic values as <type1> and <type2> and so on.
However, if your number of elements in documents can change, then what you do is that you test the API and initialise it with static text inside documents (i.e. one example element itself instead of any dynamic value) and reconstruct the whole array as a json element dynamically in the workflows when you invoke the APIs.