Skip to content
Need assistance wit...
 
Notifications
Clear all

Need assistance with JSON data structure creation

7 Posts
2 Users
0 Reactions
4 Views
ideaurbs
(@ideaurbs)
Posts: 4
Active Member
Topic starter
 

I'm developing a video automation workflow using the JSON2Video API and require assistance with integrating their CNN-style lower-third component (basic/050). My current setup processes videos from Airtable records, but I'm encountering issues with the JSON structure when attempting to add the lower-third component.

This is a combined JSON structure with video element and CNN-style component

json
{
“elements”: [
{
“src”: “{{28.url}}”, // Your video URL from the feeder
“type”: “video”,
“zoom”: 0,
“width”: “{{56.output_width<span class="chcklst-box fa fa-square-o fa-fw"></span>}}”,
“height”: “{{56.output_height<span class="chcklst-box fa fa-square-o fa-fw"></span>}}”,
“duration”: “-1”,
“position”: “center-center”
},
{
“type”: “component”,
“component”: “basic/050”,
“settings”:
{
“card”:
{
“vertical-align”: “bottom”
},
“headline”:
{
“text”: “{{56.hooks}}”,
“font-size”: “auto”
},
“lead”:
{
“text”: “{{56.call_to_actions}}”,
“font-size”: “auto”
}
},
“start”: 3
}
]
}

The Challenge: When attempting to generate a single JSON data structure incorporating both elements, callin.io’s Create JSON module only produces the video element and omits the component element. It appears the “create json module” may not correctly handle key : [array of values]

I need advice on:

  1. The correct method for combining these elements

Any assistance or examples would be greatly appreciated!

 
Posted : 10/11/2024 3:11 pm
L_Duperval
(@l_duperval)
Posts: 39
Eminent Member
 

Hi and welcome to the callin.io Community!

What are you receiving as input and what are you getting as output, and what are you anticipating?

L

 
Posted : 11/11/2024 2:09 am
ideaurbs
(@ideaurbs)
Posts: 4
Active Member
Topic starter
 

Hi, thanks for the response!

Input:

From Airtable I’m getting these fields:

  • URL for video ({{28.url}})
  • Video dimensions ({{56.outputwidth}} and {{56.outputheight}})
  • Text for headline ({{56.hooks}})
  • Text for lower third ({{56.calltoactions}})

Current Output:

When I try to create a data structure in the JSON module using my template, it only generates options for the video element:

json
{
“elements”: [
{
“src”: “video_url”,
“type”: “video”,
“zoom”: 0,
“width”: 1920,
“height”: 1080,
“duration”: -1,
“position”: “center-center”
}
]
}

Expected Output:

I need both the video element AND the CNN-style component in the structure:

json
{
“elements”: [
{
“src”: “video_url”,
“type”: “video”,
“zoom”: 0,
“width”: 1920,
“height”: 1080,
“duration”: -1,
“position”: “center-center”
},
{
“type”: “component”,
“component”: “basic/050”,
“settings”: {
“card”: {
“vertical-align”: “bottom”
},
“headline”: {
“text”: “headline_text”,
“font-size”: “auto”
},
“lead”: {
“text”: “lead_text”,
“font-size”: “auto”
}
},
“start”: 3
}
]
}

The JSON module seems to ignore the second element (component) when generating the data structure. Do I need to handle this differently, perhaps with separate JSON modules?

 
Posted : 11/11/2024 9:49 pm
L_Duperval
(@l_duperval)
Posts: 39
Eminent Member
 

Hello,

I'm interested to know why you're retrieving the URL from the iterator rather than the Airtable data. This might shed light on the issue. Have you attempted to use all the data from the iterator (28) instead of Airtable?

I'm quite confident that the JSON parser is capable of handling more intricate JSON structures than the one you've shown. Therefore, I'm not convinced that's the root cause.

If you're not achieving the desired outcomes, please provide the following information in a follow-up:

  • The input and output bundles for the different modules.
  • An export of your scenario blueprint. You can achieve this by clicking the three buttons at the bottom of your scenario and selecting "export blueprint." Please attach it to your response.

Thanks

 
Posted : 12/11/2024 2:23 am
ideaurbs
(@ideaurbs)
Posts: 4
Active Member
Topic starter
 

Hi,

Thanks for your assistance. If you were to take the precise JSON structure I shared initially and paste it into the “Create JSON Module” under the “generate” option, you'll notice that only the initial segment is produced, irrespective of any connections.

 
Posted : 12/11/2024 4:59 pm
L_Duperval
(@l_duperval)
Posts: 39
Eminent Member
 

Understood.

Could you explore an alternative method? For instance, you might consider creating three separate collections instead of an array of collections. Afterward, you could utilize a text aggregator to reconstruct the JSON format you require.

Alternatively, could you manage the process using only text, ensuring it's correctly formatted as JSON? While this approach requires more manual effort, it offers greater control.

 
Posted : 16/11/2024 12:01 pm
ideaurbs
(@ideaurbs)
Posts: 4
Active Member
Topic starter
 

Thanks, I just had time to test. I ran with the first scenario. Here is the flow that worked

“Create Json Module” → Data Structure: Two Collections (Video and Component Element)

→ “Parse Json Module” → “Text Aggregator Module” → “Parse Json Module”

Marking your response as the solution. Thanks!

 
Posted : 24/11/2024 7:53 am
Share: