How to use FlowScriptAPI.getContextID() in script includes

Rajyalakshmi
Giga Guru

How to use FlowScriptAPI.getContextID() in script includes

5 REPLIES 5

Tanushree Maiti
Tera Patron

Hi  @Rajyalakshmi 

 

What is your use case??

 

You can check  servicenow documentation : https://www.servicenow.com/docs/r/api-reference/server-api-reference/FlowScriptAPI.html

 

The FlowScriptAPI API provides a method to return the context ID of the running flow.

You cannot instantiate objects of this type. Objects of this type are created automatically and are accessible only in script steps and inline scripts.

FlowScriptAPI - getContextID()

Returns the context ID of the running flow.

ParametersName Type Description
None  
ReturnsType Description
StringThe sys_id of the running flow.

This example assumes you have created a flow containing a Log action. This inline script generates the content of the Log message.

var contextId = FlowScriptAPI.getContextID();
return contextId;
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti