Print Page | Close Window

How to process JSON emails

Printed From: Parker Software Ltd
Category: ThinkAutomation Business Process Automation
Forum Name: General
Forum Description: Email2DB is an advanced email parser and automation solution.
URL: http://www.parkersoftware.com/forum/forum_posts.asp?TID=9424
Printed Date: 20 May 2022 at 3:37pm
Software Version: Web Wiz Forums 11.05 - http://www.webwizforums.com


Topic: How to process JSON emails
Posted By: mitesh281
Subject: How to process JSON emails
Date Posted: 31 May 2021 at 12:01pm
Hi, 

I want to process email which has JSON text in it. I found a link to use "Read JSON Document" action. However my question is how can I process multiple blocks of JSON text because number of block will be different in each JSON formatted email. Below is a sample reference email text

{
  "data": [
    {
      "applicationName": "Test App", 
      "Status": "Green", 
      "account": "1111", 
      "Duration_AppLoad": "10.10", 
      "dbCluster": "Test_Cluster", 
    }, 
    {
      "applicationName": "Test App1", 
      "Status": "Red", 
      "account": "2222", 
      "Duration_AppLoad": "11.11", 
      "dbCluster": "Test_Cluster2"
    }
  ]
}

I want to insert value of applicationName, Status, account, duration_appload and dbcluster fields in the DB. I have used below format to fetch data

/json/data/[1]/applicationName = %applicationName%
/json/data/[2]/applicationName = %applicationName%

How can we replace [1], [2] to make it dynamic?

Thank you for help.

Regards




Replies:
Posted By: Liam7982
Date Posted: 01 Sep 2021 at 3:38pm
Hi,

Thank you for letting me know about this,

If you are using TA5, you can use the extract field action to pull directly from the JSON, set it to a repeating block and call another automation to do the DB updates.

However if you are doing this with TA4 the process is pretty similar as you just need to get the JSON output in a variable and do a regular extract from it, when doing this make sure to use the repeating block option.

Kind regards Liam



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.05 - http://www.webwizforums.com
Copyright ©2001-2016 Web Wiz Ltd. - https://www.webwiz.co.uk