Displaying field values in a workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2014 06:10 AM
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';
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2014 06:50 AM
First, to make sure I understand you correctly, this is a workflow making tasks from data entered into a first task, right? In any case, g_form is inappropriate for this situation as g_form is a client-side only class. Try changing all the g_form.getValue's to current.fieldName. For example, g_form.getValue(u_dns_entries_to_delete) would be current.u_dns_entries_to_delete. that should pull the data from the record the workflow is running on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2014 07:15 AM
Thanks for the reply. Actually the fields are only displayed on the first task in the workflow (see below)
The subsequent tasks only need the data entered from those fields. I want to display the values in the task description.
In my example above, I changed the g_form to current and its no longer displaying any information in the description field.
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';
If there is a better way for me to accomplish this other than the workflow that info would be helpful as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2014 07:27 AM
Also would it make a difference using current.fieldname if the fields were created on the sc_task table and not the sc_req_item table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2014 07:43 AM
You should disregard the current.fieldName, for now. This was under the assumption the workflow was had direct access to the fields.
I assume the screenshot is from the sc_task record? How are we getting access to the record from the workflow? It might be easier to use a 'run script' activity to do a GlideRecord query to find the catalog task you had just created.