Script to update connection details inside flow action

conanlloyd
Giga Guru

We're finally using the Post Clone Clean Up scripts to automate the multiple steps we had been doing manually and have run up against a snag.  We have 4 flow actions that need to have their connection details updated per instance.  Manually we do the following:  Go to Flow Designer -> Actions,  update the connection alias, save, and publish the action.

 

While I can find the actions table, I cannot find a way to accomplish the above through a script instead of going to the flow editor manually.  Can anyone help me script this so it can be in our post clone script?

 

4 REPLIES 4

NBeheydt
Tera Expert

 Did you ever find a resolution for this?

No I did not. We’re still doing that step manually. 

I was able to get this to work by using a script in the Connection Alias in the flow action.  I pass in the  instance system property (glide.servlet.uri) as an input to the action, check what environment it is, then return the connection alias sys_id for that instance.  Hope this helps.

Example:

var mid = fd_data.action_inputs.instance.toLowerCase();
if (mid.indexOf('dev')>= 0) {
return <sys_id of connection alias for dev>;
}
else if (mid.indexOf('test')>=0){
    return <sys_id of connection alias for test>;
   
}

Muhammad Salar
Giga Sage

If i understand it correctly,
you can create Connections and Credentials Alias record then select that connection in Flow Action

Then, you can update it in Connections and Credentials Alias record manually or by script, it will automatically update in flow action.