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.

Setting Approval group based on field value's approval group

Steve7
Mega Contributor

Hi,

Currently I'm making a service request where I am making an approval - group activity (in the workflow) and trying to use a form field value's assignment group.

I've been attempting the following script to no success. Please see below:

var answer = [];

answer.push(current.variables.ci_name.assignment_group);

Note: ci_name is the form field value name (and pulling its value from the cmdb_ci table), and the assignment_group value is the field name on a Configuration Item form.

 

Any help is appreciated. Thank you

1 ACCEPTED SOLUTION

Steve7
Mega Contributor

Upon review of another team member's perspective, the coding I had opened the thread for is working now as expected. 

 

Honestly I'm not 100% sure why the correct code was failing. I appreciate the alternatives listed. Those should be used if needed.

 

Thank you all,

View solution in original post

9 REPLIES 9

change_control should be the column name in the cmdb_ci table. 

My variable "ci_name" is picking a value from the "cmdb_ci_server" table, but even in that table the Approval group should have a column name of "change_control". 

Is my error message related to not pointing to the correct field on the ci or elsewhere?

 

Thank you for everyone's help so far.

Could you try change the variable to reference to cmdb_ci and then try to pick the same record and see if that works?

kente
Tera Guru

Is it erroing when the flow is run?

And have you tried to log out current.variables.ci_name.assignment_group.

 

Steve7
Mega Contributor

Upon review of another team member's perspective, the coding I had opened the thread for is working now as expected. 

 

Honestly I'm not 100% sure why the correct code was failing. I appreciate the alternatives listed. Those should be used if needed.

 

Thank you all,

Glad you found a solution.

If you don't mind, please mark replies from others as Helpful, if they were.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!