The CreatorCon Call for Content is officially open! Get started here.

Clear or update a catalog variable via the workflow

SMuir
Mega Guru

I have a workflow I have been working on and I need to add text or clear a  free text field to ensure a rollback activity will work. 

I have a question on the catalog item name finance_mgmt_ams_sap_finance_estimate

Set values activity does not allow me to pick variables from the drop down list, what is the best approach to clear the value or add a value to the current field that is no longer empty using the workflow. 

I have tried a run script activity and this fails to work it just give me  a not defined error. 

Can anyone help? Nothing I have tried is working. 

find_real_file.png

 

Script highlighted  in the workflow is

//var amsEstimate = current.variable.pool.finance_mgmt_ams_sap_finance_estimate = 'null'; //tried '' instead of Null and get undefined

current.finance_mgmt_ams_sap_finance_estimate.setValue( ""); // tried and not working either still get not defined

 

Docs don't seem to be helping much either https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/administer/using_workflows/concep...

I look forward to the assistance. 

Kind regards

Sarah

 

1 ACCEPTED SOLUTION

Nitin_NOW
Tera Guru

Try this line and see if it works.

var amsEstimate = current.variable_pool.finance_mgmt_ams_sap_finance_estimate = '';

Please hit correct based on impact of response.

Thanks

View solution in original post

2 REPLIES 2

Nitin_NOW
Tera Guru

Try this line and see if it works.

var amsEstimate = current.variable_pool.finance_mgmt_ams_sap_finance_estimate = '';

Please hit correct based on impact of response.

Thanks

SMuir
Mega Guru

Thanks for the help that worked. 🙂