JsonParserOperation failed: The transformer returned null as output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 12:51 AM
I created a custom Flow Action which calls a REST Endpoint and I am parsing the response from REST call using the JSON Parser step.
JSON Parser step works fine whenever I get response in payload, however in some valid cases when there is no data to send the third party application returns empty response in the payload and in such cases JSON parser step is failing with "JsonParserOperation failed: The transformer returned null as output" error.
How can we handle the JSON parser step not to error when the response is empty ?
I already tried configuring the "If this step fails": Don't stop the action and go to the next step. but this JSON parser step still fails.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 01:23 AM
in that custom action you can ensure parsing is done when the response is not empty
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 01:32 AM
How can we stop the execution in the previous step, if the response is empty ? I don't think we can skip execution of any step like JSON Parser within the action.
I want the action to complete as success with empty output, since there is no response from REST call.
Thank You,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 01:30 AM
Anyone figured this one out? I have the same issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2025 07:24 AM
We have solved for this issue by creating a script action prior to the JSON parser.
The script will check to see if the response body is empty and if so throw an error such that we don't go to step 3, the JSON Parser.
Then in the Evaluation we handle the error. Here we check to see if the error came from step 2.
Note it is set as "Don't treat as error" because we don't want the flow that is using the action to error out because the step in the action is treated as an error. We want to send the action status code of 100 back to the main flow and allow it to proceed accordingly. Ex, if status code is 100 then do X. In our case we were querying membership and if there are no members returned by the API call then of course you get an empty response body. This isn't an error, it simply means the main flow needs to branch in a different direction. Therefore, we check for action status code == 100 and proceed accordingly.