- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 03:29 PM
Hello everyone,
I am using the Advanced script field on the Catalog Task workflow activity in order to create some custom text in the Description field of the current task. In particular, there are 4 fields/variables we would like to include - 2 variables from the current Catalog Item; the current task's number; and the current task's "Opened by" field (which is a reference to the sys_user table). I can get the Catalog Item Variables to appear but not the fields from the current Catalog Task.
Here is my code from the Advanced script of the Catalog Task where I am defining these values:
var emp = current.variables.employee_id + ', ';
var ldw = current.variables.last_day_worked + ', ';
var num = task.number + ', ';
var openedBy = task.opened_by.user_name;
What is the proper syntax for defining values from the current task? I have also tried:
- current.task.####
- current.sc_task.####
Again, the first 2 lines are generating values - lines 3 and 4 are not.
Solved! Go to Solution.
- Labels:
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 07:47 PM
Other way you can do is once task is created use run script and query the task and update the description field with the task values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 05:08 PM
Try.
current.number
current.opened_by.user_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 09:18 AM
Steven,
Thank you for your reply. I have tried that but unfortunately, current references the current Requested Item record, not the current Catalog Task record. By using current.number, I get the Requested Item number instead of the Catalog Task number.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 07:47 PM
Other way you can do is once task is created use run script and query the task and update the description field with the task values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 09:26 AM
Your reply got me thinking... I'm not positive, but I believe that the Advanced script field in the Catalog Task workflow activity is executed before the task is created. Therefore, you would not be able to use this script to get values from the current task, you could only set values.
If this is the case, I think I can use your recommendation of doing this via a Run Script activity in the workflow.
Thank you!