Create a custom Flow action to Update Record with Workflow(false)

daisybora
Tera Contributor

I am trying to create a custom flow action for Update Record with setWorkflow(false).

Similar to the OOB action, I have added three inputs:

Table (type Table Name)

Record (type Document ID, dependent on Table)

Fields (type Template Value, dependent on Table)

I am using a custom script step with the following code, where setWorkflow(false) does not seem to work. Does anyone have any suggestions please. 

 

Note: The input.fields is in this format: 

'install_status=1^stockroom={"display":"StockNameDisplayName","value":"1d62222bdb9c08d0d9268e3505961970","sys_id":"1d62222bdb9c08d0d9268e3505961970"}'
 
Script Step:
var gr = new GlideRecord(inputs.table);
gr.addEncodedQuery('sys_id=' + inputs.record.sys_id);
gr.setLimit(1);
gr.query();
if(gr.next()){
        gr.applyEncodedQuery(inputs.fields);
        gr.setWorkflow(false);
        gr.update();
}
5 REPLIES 5

daisybora
Tera Contributor

Hi All,

Thank you for your responses.

The input is a template value that can be used dynamically hence I will need to set the JSON object for stockroom or any other reference fields.

The intent of this is to create a custom flow action similar to Update Record (but just including setWorkflow(false)).