JSON Parser Step Error - Flow Designer

Rachna S
Tera Guru

Hi,

How do I use JSON parser step in flow designer along with 'REST' response saved as attachment ?

So I am making a Get REST call and saving the JSON response as a .txt attachment in servicenow. I'd like to use JSON parser step after this to parse response saved in the attachment. I'm looking up for the attachment and passing it to JSON parser step. However, it throws an error stating this 'JsonParserOperation failed: Extraction of Complex Object failed: JsonStreamParser[0]: JSON must be an object or an array: '4' com.glide.transform.transformer.exceptions.InvalidStructureException'

Please advise.

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@Rachna S 

Please refer below links

PARIS INTEGRATIONHUB JSON PARSER AND PAYLOAD BUILDER

Flow designer action, parse JSON rest response

Parsing a REST Response

Exercise: Parse REST Response

JSON parser step

Regards
Ankur

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

Hi Ankur,

I know how both the steps work. I am able to use them if I do not save REST step's response as attachment. However, when I save it as attachment and pass the attachment to JSON Parser step, it throws error. 

Hi,

please share screenshot and script which throws error

Regards
Ankur

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

Hi Ankur,

I've figured this out. It threw error only when I used MID server to make a REST call. Thank you though.