How to extract JSON Output from Flow Designer step to Create a record in the Target table

Haceena Shaik
Tera Expert

Hi All,

 

I had a business requirement, I want to extract values from JSON and create a record with the data from JSON in Target table.
Parsed JSON with custom action

{
    "a": {
        "extracted_values": {
            "KeyGroups": [],
            "_": {
                "data": [
                    {
                        "is_reviewed": "1",
                        "metadata": "",
                        "data": "SBIN0011256",
                        "target_field": "u_ifc_code",
                        "key_type": "Text",
                        "key_id": "17e188b9c30286106001d81bb001317a",
                        "key_display_name": "IFC Code",
                        "index": 0,
                        "availability": "available",
                        "group_order": "1",
                        "is_flagged": "0",
                        "target_record": null
                    },
                    {
                        "is_reviewed": "1",
                        "metadata": "",
                        "data": "8563261452630",
                        "target_field": "u_account_number",
                        "key_type": "Text",
                        "key_id": "774976e9c38a46106001d81bb001311c",
                        "key_display_name": "A/C No.",
                        "index": 0,
                        "availability": "available",
                        "group_order": "0",
                        "is_flagged": "0",
                        "target_record": null
                    }
                ],
                "target_table": "u_extracted_cheque_data"
            }
        },
        "task_id": "0b4bbae9c38a46106001d81bb0013189",
        "state": "Processed",
        "message": []
    }
}

I want extract Account number and IFC code into target table

 

 

Thanks in Advance.

 

Regards,

Haseena

 

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Haceena Shaik 

you can use custom action to parse and create the records or use json parser step

Script for JSON Parse Action in Flow Designer 

JSON Parser step - Flow Designer 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar  

Thanks for the quick response!

 

I tried for the same but the JSON parser action is not available to use.

 

Regards,

Haseena

@Haceena Shaik 

then please use custom action and have script. check 1st link shared

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

I tried custom action from the links you shared.
In those I found data and data_raw in the JSON. But in my input JSON to the custom action there's no raw value.
I tried tesing by passing JSON manually by giving raw value, then its working fine.

 

Now problem is how to get the raw data for the field value

SH1.png

But the problem in my with the JSON.

 

How to convert JSON to get Raw values too.

 

Regards,

Haseena