I am hoping someone can tell me:
1.) If I am configuring the API Connector Call incorrectly OR
2.) Bubble can’t Patch to Nested Objects.
AND
That someone can find me a way to move forward!
I faced a similar problem for loading nested json into the database and @georgecollier saved my ass by coming up with a clever work around. Hoping that George or someone else will be able to come to my rescue on this occasion as well.
I am trying to update the Vimeo embed Parameters using the Vimeo API.
I have one Vimeo Patch working like a charm. See below.
When I put this into the API Body Window, it seems to want to recognize it but it fails. I am unable to change the name from true for the value key pair and the system doesn’t create entries for all the variables I have brackets for.
So, am I able to do a Patch with JSON that has three layers of hierarchy?
How many layers of hierarchy can Bubble handle?
I am trying to replace “true” with “watchlater” in the case of the first field but it will not let me. There are boolean values so I don’t think they could have another field name.
You’ve name two variables in the payload: true and false and it has declared them for you below. Which are you not seeing?
Looking at your Vimeo example above you’ve used the key names as the names for the dynamic variables. In this example you seem to be using the values. What’s the reason for that?
I may have misused the word variable in this case.
What I should have said was that the system is not creating entries for all seven key value pairs that appear in the JSON Body. (eg “watchlater”: ,…). The system only creates two entries in total.
I have not changed the names of the dynamic variables because the system will not let me change them. If you look at the image of the vimeo embed API call that is working, I was able to change the names.
Which leads me back to my primary question. Can Bubble’s API Connector handle the level of JSON object nesting that I have shown in the second image?
Hi @ Jici,
Thanks for the question. Forgot to tag you in my response last night.
You said.
By that do you mean that it is in fact possible to use nested JSON in the JSON body of a Bubble API Connector Patch call?
The call that is working is only is two brackets deep. The one that does not work is three brackets deep and I have additional key value pairs that would make it four curly brackets deep.
@chris.williamson1996
Thanks!! You are absolutely right. Every other time I had done one of these the values have been unique so I remembered the process better. My concerns about whether Bubble could handle nested object did not help. I remembered changing the names of the variables in the key value pair box instead of the JSON Body Window. Doh!!!
========================
To those who get confused by the same thing I did, I am attaching an image of the right way to do things that Chris has outlined above.
The key value pair input boxes are created when you put “<” and “>” on either side of the value entry in the JSON Body. I was trying to change the name of the key in the box that was created - while what I needed to do was change the name inside the brackets (“<”, “>”).
When the box is first created - it puts the name of the value that was in the JSON file you are using. What should have been my clue to my mistake was that it would only create two key value pair entries. The reason being that you cannot have two identical keys (field names). As all my values were boolean (ie true or false), the system was only able to create two entries one for true and the other for false.