Why can't I get all the values/outputs in PARSE JSON module?

I’m trying to get image_hash values from 4 images and then use them in an HTTP Make a Request module.

I have the images on the drive. I download them via HTTP and use PARSE JSON to get only the image_hash (image one below). I do this for four images. Each one has its hash.

The output from the PARSE JSON is correct, and I have one output for each image, which means it is working.

The problem is that after PARSE JSON, I can only map 1 of the images (image two below). The other three values that came from PARSE JSON do not appear.

When I go to the next module, which is an HTTP Request, I can’t see all the outputs from the PARSE JSON!

I can only see one of the outputs (or one of the image_hash). What is happening? Where are the others?

What should I do to be able to see all the outputs from PARSE JSON and then be able to map the values?


Thanks!

Hi @alexandr.e

The issue here is when your trying to map in your HTTP module, you are only seeing the output from the first Bundle of the Parse JSON module.

The module output multiple bundles so you would either need to send multiple HTTP requests or aggregate the output from your Parse JSON.

5 Likes

Thanks for the reply @IOA_Harman. How can I aggregate the output from the PARSE JSON?

The problem is even when trying to send multiple HTTP requests, I can not see the other image_hashes to map them. I can only see one.

Try using the array aggregator module, other option is text aggregator

2 Likes

I tried with Array Aggregator, but it still brings just one image, not the four.

What should I do? I am getting bald pulling my hair out thinking how to solve this.

Hey @alexandr.e
you actually have 4 different bundles in parse json for 4 different hashes
If you need to use one image at a time in http module
It will do it automatically
However if you want all of the image hashes to be used in one execution of http module you need to use an aggregator
Now it depends on the fomat in which http module accepts the hashes
If it wants array of hashes you use array aggregator and select parse json module as source
After that select hash custom field
This gives you array of 4 hashes in one bundle
If you need text you use text aggregator which will collect all the hashes as one string

You have an image hash field in your http module which means you can directly map hash variable from parse json once
And it will run the HTTP Module 4 times
Once for each bundle with hash from parse json module

1 Like

@ThakurHemansh, thanks for the reply.

The problem is that I can’t see the four hashes no matter what modules come after the PARSE JSON.

I can only see one! Please see the image below. How can I map if I can only see the hash for one image? In this case, it is image 4, called test - 4.png

If I use the Array Aggregator, I have once more four outputs with all the data/hashes I need. One output for each image.

But when I go to the HTTP module to try to map the “image_hash”, I can only see image 4. Where are all the other outputs?

Even if I try to have one HTTP for each image hash, I can’t because I can’t see the other outputs! It always shows me just one (test - 4.png).

After the PARSE JSON module, if I try to have a simple “Set Multiple Variables” module, again I can’t see all four outputs. It just shows me the same one.

Hello, I would love to help, but you have not provided sufficient information, plus your screenshots are heavily censored, making it very difficult to see what’s causing the issue.

For assistance, please provide the following:

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of each and every successful module by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

If you omit out any of these steps I will not be able to help. Thank you for your understanding.

2 Likes

Hi @samliew, I’ve attached the blueprint of part of this scenario. Please note I needed to hide some sensitive information like Access Token and Account ID. Also, there are some HTTP requests, so I am not sure how helpful this blueprint will be.

blueprint_parse_json_question.json (27.0 KB)

To recap, I would like to understand why I can’t see all the outputs from the PARSE JSON module.

The flow is:
1 - Search for image files in a Drive folder
2 - Download the image as binary
3 - Upload to the Facebook Ads Library
4 - Parse JSON to get the image hashes
5 - Be able to map the four hashes in any module that comes after the Parse JSON. In this example, I use a Set Multiple Variables to illustrate.

The problem is in between steps 4 and 5.

As shown in the image below, I can only see two images after the Parse JSON module when trying to map it in a Set Multiple Variables module.

Here you can see that I have four outputs for the Parse JSON module:

Where are the other two images? I should be able to see four images.

:trophy: My goal is to have the four image hashes and to be able to map them.

Below are the outputs. Please note I changed/messed up some text in the outputs codes to be able to share them here.

Output bundle for Uploading the image to Facebook Ads Library

[
    {
        "statusCode": 200,
        "headers": [
            {
                "name": "content-type",
                "value": "text/javascript; charset=UTF-8"
            },
            {
                "name": "vary",
                "value": "Origin, Accept-Encoding"
            },
            {
                "name": "x-business-use-case-usage",
                "value": "{\"327928207\":[{\"type\":\"ads_management\",\"call_count\":1,\"total_cputime\":1,\"total_time\":3,\"estimated_time_to_regain_access\":0,\"ads_api_access_tier\":\"development_access\"}]}"
            },
            {
                "name": "access-control-allow-origin",
                "value": "*"
            },
            {
                "name": "facebook-api-version",
                "value": "v18.0"
            },
            {
                "name": "strict-transport-security",
                "value": "max-age=15552000; preload"
            },
            {
                "name": "pragma",
                "value": "no-cache"
            },
            {
                "name": "cache-control",
                "value": "private, no-cache, no-store, must-revalidate"
            },
            {
                "name": "expires",
                "value": "Sat, 01 Jan 2000 00:00:00 GMT"
            },
            {
                "name": "x-fb-request-id",
                "value": "ArFaO2qBMnwoD"
            },
            {
                "name": "x-fb-trace-id",
                "value": "Ag6mV5Xo6WE"
            },
            {
                "name": "x-fb-rev",
                "value": "1011472253"
            },
            {
                "name": "x-fb-debug",
                "value": "K1CBkJsNKd5EDIQLxAEtk1rHtJDzve8FoLja8Lw1m2Q=="
            },
            {
                "name": "date",
                "value": "Fri, 16 Feb 2024 16:02:48 GMT"
            },
            {
                "name": "connection",
                "value": "close"
            },
            {
                "name": "content-length",
                "value": "1186"
            }
        ],
        "cookieHeaders": [],
        "data": "{\"images\":{\"2-STORY-IMAGE_2_EXAMPLE.png\":{\"hash\":\"170736f214ec279c13a5f6d6205cb735\",\"height\":1920,\"url\":\"https:\\/\\/scontent-iad3-2.xx.fbcdn.net\\/v\\/t45.1600-4\\/421778712_1202_AfCoDFsjGT-9pHHEEkNxtqZzVJ-rqxACDhrA&oe=65D55BB4\",\"name\":\"2-STORY-4509_Love_Your_Savings_Image_Ads_HotTub_1920x1080_02.png\",\"url_128\":\"https:\\/\\/scontent-iad3-2.xx.fbcdn.net\\/v\\/t45.1600-4\\/421778712_120210255_6242868921_n.png?stp=dst-jpg_p130x130&_nc_cat=100&ccb=1-7&_nc_sid=f45b03&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfAtPE0iLXdO-QKVo0ywYeiMnK97JUwqCnL7A4Rvow7knQ&oe=65D55BB4\",\"width\":1080,\"url_256\":\"https:\\/\\/scontent-iad3-2.xx.fbcdn.net\\/v\\/t45.1600-4\\/421778712_120204255_62308921_n.png?stp=dst-jpg_p261x260&_nc_cat=100&ccb=1-7&_nc_sid=f45b03&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_EbzlbV8rlr-Y3dDjU7TB0jY2vGv10A&oe=65D55BB4\",\"url_256_height\":\"464\",\"url_256_width\":\"261\"}}}",
        "fileSize": 1186
    }
]

Output bundle for the Parse JSON module

[
    {
        "images": {
            "2-STORY-IMAGE_2_EXAMPLE.png": {
                "hash": "170736f214ec279c13a5f6d6205cb735",
                "height": 1920,
                "url": "https://scontent-iad3-2.xx.fbcdn.net/v/t45.1600-4/421778712_1202010255_6242357608921_n.png?_nc_cat=100&ccb=1-7&_nc_sid=c0a1f7&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfCoDFsjGTc4Vdn5DSjH-9pHHEEkNxtqZzVJ-rqxACDhrA&oe=65D55BB4",
                "name": "2-STORY-IMAGE_2_EXAMPLE.png",
                "url_128": "https://scontent-iad3-2.xx.fbcdn.net/v/t45.1600-4/421778712_1202255_624235488608921_n.png?stp=dst-jpg_p130x130&_nc_cat=100&ccb=1-7&_nc_sid=f45b03&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfAtPE0iLXdO-QKVo0ywYeiMnK97JUwqCnL7A4Rvow7knQ&oe=65D55BB4",
                "width": 1080,
                "url_256": "https://scontent-iad3-2.xx.fbcdn.net/v/t45.1600-4/421778712_12020255_624235408921_n.png?stp=dst-jpg_p261x260&_nc_cat=100&ccb=1-7&_nc_sid=f45b03&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfB-EbzlbV8rlr-Y3dDjU7b9IsAhnwaqiTB0jY2vxGv10A&oe=65D55BB4",
                "url_256_height": "464",
                "url_256_width": "261"
            }
        }
    }
]

Try setting up an iterator immediately after the Parse Json, run the scenario once, and see if the iterator went through all 4 hashes.

If it did, do the operation you need to work on the 4 hashes immediately after, and optionally “catch” the result with an array aggregator immediately after that as well.

This is a simplified view of it (pay attention to the HTTP part, which gets called 5 times after the iterator, which is what I wanted), but it should look like this (you can also play around with this test blueprint):


blueprint (11).json (13.8 KB)

2 Likes

Hi @jay.serquina. I think I did not understand your suggestion.

I added an Iterator after the Parse JSON and the results are below.

Output for the Iterator:

ITERATOR

[
    {
        "2-STORY-1920x1080_02.png": {
            "hash": "170736f214ec279c13a5f6d6205cb735",
            "height": 1920,
            "url": "https://scontent-iad3-2.xx.fbcdn.net/v/t45.1600-4/421778712_12020255_62423608921_n.png?_nc_cat=100&ccb=1-7&_nc_sid=c0a1f7&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfCoDFsjGTc4Vdn5DSjH-9pHHEEkNxtqZzVJ-rqxACDhrA&oe=65D55BB4",
            "name": "2-STORY-1920x1080_02.png",
            "url_128": "https://scontent-iad3-2.xx.fbcdn.net/v/t45.1600-4/421778712_1210255_624235608921_n.png?stp=dst-jpg_p130x130&_nc_cat=100&ccb=1-7&_nc_sid=f45b03&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfAtPE0iLXdO-QKVo0ywYeiMnK97JUwqCnL7A4Rvow7knQ&oe=65D55BB4",
            "width": 1080,
            "url_256": "https://scontent-iad3-2.xx.fbcdn.net/v/t45.1600-4/421778712_1205_6242358921_n.png?stp=dst-jpg_p261x260&_nc_cat=100&ccb=1-7&_nc_sid=f45b03&_nc_ohc=V_PG19tylNgAX9cvKut&_nc_ht=scontent-iad3-2.xx&edm=AJNyvH4EAAAA&oh=00_AfB-EbzlbV8rlr-Y3dDjU7b9IsAhnwaqiTB0jY2vxGv10A&oe=65D55BB4",
            "url_256_height": "464",
            "url_256_width": "261"
        },
        "__IMTINDEX__": 1,
        "__IMTLENGTH__": 1
    }
]

I have 4 images and 4 outputs in the Parse JSON module.

I do not understand why sometimes I can only see 2 images to map in the following module, and sometimes I can see only 1. (see my previous post, in that example, I could see two images to map, in this one, I can only see one).

Apparently, according to how I generate the JSON structure, I see TWO images to map in the following module or sometimes only ONE image to map. It depends on the way the JSON structure is created.

Is it a problem with the JSON structure? I have no idea and am lost. Why I can’t see the 4
images? Or a field called “hash” that I can map all four hashes… :confounded: