Welcome to Albato Help

How to Use Parse JSON Tool


IN THIS ARTICLE

In many scenarios, a specific app may send you a single parameter containing a complete JSON. This can be the result of an HTTP Request or a Webhook trigger in apps that do not yet have a native connection with Albato, or from an app that naturally sends information in this format.

Whenever this happens, processing the data and obtaining each element separately for use in the next steps of your automation may seem challenging.

However, by using the Parse JSON tool from Albato, you can configure your automation in just a few steps so that this type of situation is no longer a problem.

See below how to use the tool.

Attention: This tool decodes JSON, not XML.

 

How to Use Parse JSON Tool

  1. Open the desired automation and add the Parse JSON step after the trigger or action that receives the JSON. Click the plus icon to add the tool.

Screenshot 01

  1. Select Parse JSON.

Screenshot 02

  1. In the JSON String field, select the parameter from the previous step that contains the JSON value. Then click to add the fields from this JSON.

Screenshot 03

  1. Add each field name and its format. Check how the JSON is being sent and fill in the fields accordingly.

Let's assume we receive the following JSON.

{ "order_id": "123456", "customer_name": "James", "customer_email": "james@email.com", "customer_phone": "+55 11 99999-9999" }

In this case, it would look like this.

Screenshot 04

Attention: Make sure to fill in the fields using exactly the same name and format as they appear in the JSON. If you do not know how the data will arrive, run a test first, check the history to see how the information is being sent, and then configure the Parse JSON step.

  1. In the following steps, use each JSON field individually by selecting the parameters associated with the Parse JSON step.

Example.

Screenshot 05

Now your automation will be ready to use, and you will no longer need to worry when receiving JSONs as strings in previous triggers or actions in your workflow.

See below a real and very useful example where this tool can be applied.

 

How to Use Parse JSON to Get Data from Content Published on External Websites

It can be useful to monitor publications from blogs and websites of your main competitors. This type of practice can help not only track market trends but also evaluate external strategies, perform benchmarking, or simply have a source of ideas to create content for your company.

For this, you can use an HTTP Request that collects data from new publications on the desired website.

However, the challenge here is that this information will arrive combined into a single JSON.

Let's assume the response from your JSON brings a string like this.

{ "seo_title": "How the new crypto tax crackdown hits your wallet right now", "meta_description": "The IRS is cracking down on crypto taxes. Here’s what it means for your 2024 returns and how real people are scrambling to avoid penalties.", "focus_keyword": "crypto tax crackdown", "category": "Finance", "tags": "cryptocurrency, IRS, tax evasion, digital assets, financial planning", "content_html": "<p>Lena’s hands shook as she stared at the screen..." } Notice that we received the complete content, including its formatting and, most importantly, some important strings inside this JSON.

  • tags
  • category
  • seo_title
  • content_html
  1. After the HTTP Request step, add the Parse JSON tool.

Screenshot 06

  1. In the JSON String field, enter the value that will arrive from the HTTP Request.

Screenshot 07

  1. Add the fields that you want to parse.

Screenshot 08

  1. Check the result. The values should be separated individually.

Screenshot 09

This way, you only need to map the fields associated with Parse JSON in the following steps.

Let's assume you want to save this information in a spreadsheet.

  1. In the Google Sheets step after JSON parsing, map the separated values like this.

Screenshot 10

This way, you will have a practical and simple solution that processes the complete content information and saves it in your spreadsheet, allowing it to be analyzed more efficiently with the data properly stored in the corresponding columns.

You can also apply this same logic to any trigger or action that receives a complete JSON inside a single string, as described at the beginning of this article.

 

If you have any questions, our support team will be happy to help you at every step while configuring your automation.

Did this answer your question?