Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

flow to be triggered from post clone script

CV1
Tera Contributor

Hello everyone ,

Plz advise on how to  create  flow to be triggered from post clone script to do the following:

Assign admin role to ABC  group
Assign admin role to the remaining users who will need it (User A,User B,UserC)

Set theme for the instance

TIA

4 REPLIES 4

Community Alums
Not applicable

@CV1 

You need to write a post-clone script that will execute after the cloning process. This script will call your flow.

(function() {
// Trigger the flow after the clone
var flow = new FlowAPI();
var flowId = '<Flow ID>'; // Replace with the actual flow sys_id
flow.startFlow(flowId);
})();

And to set theme you will have to create user preference.

Hope this will help you.

 

Amit Verma
Kilo Patron
Kilo Patron

Hi @CV1 

 

You can trigger your flow through FlowAPI. For your flow, you can get the trigger script created by navigating to your flow and clicking on Create Code Snippet.

 

AmitVerma_0-1730699117677.png

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

CV1
Tera Contributor

Thank you for the reply, I was looking for help on how the flow/subflow need to trigger to achieve the above conditions, if a subflow , the what will be the inputs

how to preserve the theme.

TIA

Community Alums
Not applicable

@CV1 the glide.ui.polaris.theme system property stores the sys_id of the currently active theme. You can leverage this property to preserve and reapply the theme during a clone.