Displaying field values in a workflow.

amatthews
Kilo Explorer

I have a workflow with several task.   On the first task, values are being populated in several fields.   The fields are hidden on all   task that follow through a UI policy but I need the values that were entered from the first task to display in the description field of some of the tasks that follow.   Here is my script for one of the task where I just need the populated field information displayed in the description field.   This is not working so if anyone knows how I might accomplish this that would be greatly appreciated.

 

task.description = "Server Name:   " + current.variables.u_server_name.getDisplayValue() + '\n' +

"DNS entries to delete:   " + g_form.getValue(u_dns_entries_to_delete) + '\n' +

"iLO DNS entry to delete:   " + g_form.getValue(u_ilo_dns_entry_to_delete) + '\n' +

"IPInfo.bat:   " + g_form.getValue(u_ipinfo_bat) + '\n';

9 REPLIES 9

amatthews
Kilo Explorer

Yes the screenshot is from the first sc_task record created from a catalog task in the workflow.


Also, where is task.description going to? Is this another catalog task we are creating, or something else?


amatthews
Kilo Explorer

Yes the task description will go to the next Catalog Task that will kick off when the first is closed.


It might be best to use a run script activity to perform a GlideRecord query to grab the previous catalog task. Then, also in the run script, you can construct the description and store it in the scratchpad, to be used when you make the next catalog task.


Sandeep Kumar6
Giga Guru

Hi Amatthews,



As i can see in you code that you are using g_form (works at client side) in workflow (which works at server side).


to avoid this error you can use current.variable name incited of g_form.



You can do something like :



task.description = "Server Name:   " + current.variables.u_server_name.getDisplayValue() + '\n' + "DNS entries to delete:   " + current.u_dns_entries_to_delete + '\n' +


"iLO DNS entry to delete:   " + current.u_ilo_dns_entry_to_delete + '\n' + "IPInfo.bat:   " + current.u_ipinfo_bat + '\n';




Thanks


Sandeep


Please hit and like if you find helpful.