- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 01:02 PM
Greetings,
We have an action which makes a rest call to our monitoring service. It then returns a json string, from which we need a single field.
We attempted to use the built-in JSON parser to grab that field, but (at the recommendation of HI support) were told to just use a custom script.
That custom script works, and then it stops working because the step itself refuses to accept the variable (the JSON string). I made a HI ticket for this problem, but the response is slow and so far not helpful, so I thought I would post here.
Here is the script step and script:
Here is an execution where that input variable jsonString is acquired and used. You'll see that accepts the JSON body from the REST string and passes it into the field :
Then there are occasions where we test the same device and the jsonSTRING input variable is simply not defined by the script step, and the entire flow hangs, waiting indefinitely for that variable that never comes:
The execution log does not have a row for the input variable. Obviously, the script does not run because it needs that value.
Any info, help, references, even a suggested change to how we are doing this are welcome.
Thanks.
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 06:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 08:37 AM
Ok so the response body isn't making it to your script step?
If not I would try to remove the input value passing into the jsonString input parameter then resave. One other thought if your action is not in global scope then update line #3 to:
var jsonObj = global.JSON.parse(jsonString);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 06:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 07:45 AM
Hi David, the "global" piece to the original script appears to have solved it. Our systems team is running the entire flow through a lot of paces to make sure, but I think it looks good to go. Thanks so much for your assistance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 08:11 AM