How to access glide record from Scripted REST API after subflow call

Saquib Mohammed
Mega Guru

I have created a scripted REST api where I read the input parameters and then call a subflow based on the request parameters.

However, after the subflow call, it appears as though the control is not coming back to the scripted REST api. I have added a simple log after the subflow call but even that doesn't get logged.

This is the call to subflow - (IncidentTaskUpdate is my subflow name)

sn_fd.FlowAPI.executeSubflow('IncidentTaskUpdate', inputsUpdate); 

Immediately after this subflow call, i have added a log statement as below - 

gs.info("After subflow call");

However, even this is not getting printed in the system logs.

The subflow has 2 simple steps (2 inputs correlation id and work notes, No Outputs) - 

1. Lookup record based on the correlation id

2. Update record with work notes

 

Any pointers???

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hello,

Have you verified if the subflow is even being called? You're mentioning a lot statement after the fact, but you haven't told us if the subflow has ran and updated the work notes, etc. Also, I believe the suggested API has changed to: https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/sn_fd-namespace/ScriptableFlowR... 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen,

Yes the subflow is updating the work notes in incident task correctly as expected. And we are still on San Diego

Abhay Kumar1
Giga Sage

@Saquib Mohammed i am not sure if you are using exception handling (try/catch), if not I will suggest you to keep you code in try and capture error in catch.

Hope this can suggest you something to check further.