Forum Academy Marketplace Showcase Pricing Features

Extract key/value pairs from nested json

Hello!

I’m stuck and am hoping someone from the community here can help. I’ll try to make this as simple as possible.

I’m using a third party API to parse documents and it returns the value to bubble in a deeply nested JSON string format - as expected, this works fine.

The problem - I need to use the data (key’s and their associated values) inside the json to update (make changes to a thing) fields in a data type record in my database.

The only thing I can pull from the json is the entire value - which is huge.

I’ve tried to inject custom javascript to flatten the data and see if bubble will recognize the different fields within the json but I can seem to make it work.

I need to update about 20 fields in my database each time I parse a new document and the information I need to do that is clearly available inside the nested json string.

The question - How can I extract specific information from a nested json text to be used in a workflow to “Make changes to a thing”?

below is an example of the nested json data

{
“Resume”: {
@xml:lang”: “en”,
@xmlns”: “http://ns.hr-xml.org/2006-02-28”,
@xmlns:sov”: “http://sovren.com/hr-xml/2006-02-28”,
“ResumeId”: {
“IdValue”: null
},
“StructuredXMLResume”: {
“ContactInfo”: {
“PersonName”: {
“FormattedName”: “John Doe”,
“GivenName”: “John”,
“FamilyName”: “Doe”
},
“ContactMethod”: [
{
“WhenAvailable”: “anytime”,
“PostalAddress”: {
“CountryCode”: “US”,
“Region”: [
“CA”
],
“Municipality”: “San Francisco”
}
},
{
“Telephone”: {
“FormattedNumber”: “(650) 555 - 1234”
}
},
{
“Use”: “personal”,
“Location”: “onPerson”,
“WhenAvailable”: “anytime”,
“InternetEmailAddress”: “[email protected]
},
{

Please help!!

@david17 @erik.bubble @mishav

When you initiate the Api via plugin you should be able to see all of these fields individually, can you see that?

Thanks for responding, David.

No I don’t. Only the “parent keys”. None of the nested fields are present.

It’s hard to see in my original post because the bubble forum flattened it all but some of the fields are 2,3, or even 4 nests deep in the API response

2 Likes

and if you can see the fields individually, then how do you pull out certain values?

1 Like