Extract one value from an JSON array

Hi,

I wondered how I could extract one value from a JSON object? This is an array of JSON files being returned from an API.

I would like to extract the once value and then save it to a list for each JSON object in the array.

I’m sure this is simple but I struggled a little with the JSON parser plug-ins, I guess this will just confirm that it was the right path I was heading down or not

Thank you,
Jack

Have you checked out my Backend Utilities? I have a server-side function that accepts JSONPath queries and returns a list of matching serialized JSON (text).

Hi Aaron,

Ths is great thank you for telling me about this. I wondered if you could help me find the expression needed to parse the “symbol” value out of this JSON object?

[
     {
          "assetContractAddress": "0x28cEe78b631FCFde3f441306294cB83207f694FF",
          "buyoutPrice": {
               "type": "BigNumber",
               "hex": "0x11c37937e08000"
          },
          "currencyContractAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
          "buyoutCurrencyValuePerToken": {
               "name": "Ether",
               "symbol": "ETH",
               "decimals": 18,
               "value": {
                    "type": "BigNumber",
                    "hex": "0x11c37937e08000"
               },
               "displayValue": "0.005"
          },
          "id": "1",
          "tokenId": {
               "type": "BigNumber",
               "hex": "0x00"
          },
          "quantity": {
               "type": "BigNumber",
               "hex": "0x01"
          },
          "startTimeInSeconds": {
               "type": "BigNumber",
               "hex": "0x626971ac"
          },
          "asset": {
               "name": "Jack Morgan - Estrella EP",
               "description": "These tokens give access to the Estrella EP hosted on MetaRooms.ooo",
               "image": "https://ipfs.io/ipfs/QmPMhZLcNvwxaAN3w4BEjtuBt6kuaMxfxcGUgMft3bMKTZ?11.jpg",
               "id": {
                    "type": "BigNumber",
                    "hex": "0x00"
               },
               "uri": "https://gateway.ipfs.io/ipfs/QmU1diFL1BL2ff2wAFGcxZrYDt6ZgX38eNyZTs1X9Xh8Ae",
               "attributes": [],
               "seller_fee_basis_points": "200",
               "fee_recipient": "0xBe9A7BA19Ed996D36666fee7746113DcbBC114Ba"
          },
          "secondsUntilEnd": {
               "type": "BigNumber",
               "hex": "0x011e618fac"
          },
          "sellerAddress": "0xeA2899E9CaeB476668A3762f775bA24e661F83fc",
          "type": 0
     }
]

Thank you!
Jack

If you set the data type in API connector to JSON, you will be able.to access the data from Bubble function directly. I dont see any reason to use another tool with this type of json

Im returning a stringified JSON from an plugin and I used one function on this tool to format like it is above. Could I still use the method you described?

What I suggest, is to create a json file and store it in Bubble file and insteadof returning a stringified json, return the url of the file. Call this url dynamically in API connector.
Another solution is to create an API Connector and enter the response manually and follow the guide from @lottemint.md here Output an object for server-side/client-side

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.