How to extract JSON Output from Flow Designer step to Create a record in the Target table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 10:21 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 11:02 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 02:28 AM
Thanks for the quick response!
I tried for the same but the JSON parser action is not available to use.
Regards,
Haseena
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 02:34 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 02:43 AM
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
But the problem in my with the JSON.
How to convert JSON to get Raw values too.
Regards,
Haseena