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

Abhay Kumar1
Giga Sage

@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

@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.