gs.getSessionID() is throwing an error

Madhan007
Tera Contributor
var sessionID = sn_fd.GlideActionUtil.setEncryptedOutput(util.getSessionId());
    if (typeof sessionID === 'string' && sessionID == '') {
        throw new Error("Invalid Connection & Credential Alias.");
    } else {
        outputs.session_id = sessionID;
    }
The above lines of code are used in a script step in a Data stream.
If the session ID is empty, we are throwing an error. why would be the session ID be empty when the subflow runs as system and how can we resolve it ?

Thanks in Advance !!
5 REPLIES 5

Brad Bowman
Kilo Patron

Would need to see the entire script.  Is util defined?

Ankur Bawiskar
Tera Patron

@Madhan007 

what's your business requirement?

where is this script written

some screenshots

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

Madhan007
Tera Contributor

@Ankur Bawiskar , @Brad Bowman  , Thanks for your Reply

Madhan007_1-1766393752036.png

 

 

We are using this in a flow designer Data stream

 

@Madhan007 

we don't know what input you are passing to that function

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