- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 08:53 AM
I am trying to set the request due_date variable to a date variable the user picks on a form. I can't seem to get it to change on submission. I setup an onsubmit script trying to change it and it didn't work. I set a run script in the workflow and it didn't work. The goal is that the task sets its due date as the request due date which should be set to what the user inputs on the form but I can't seem to get it to get that value.
Thanks in advance for any help.
Edit:
I guess the screenshots are broken. The run script I tried is currently this:
current.due_date = current.variables.desired_due_date;
But I have done a couple of variations with no success.
The onsubmit I tried was this:
function onSubmit() {
//Type appropriate comment here, and begin script below
var desired = g_form.getValue('desired_due_date');
g_form.setValue('due_date', desired);
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 09:41 AM
Hey
If you are trying to populate Request's due date(and not RITM), then you will need to glide the request record to update.
Try below script in your run script activity:
var reqGR = new GlideRecord("sc_request");
reqGR.get(current.getValue("request"));
reqGR.setValue("due_date", current.variables.desired_due_date);
reqGR.update();
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 09:41 AM
Hey
If you are trying to populate Request's due date(and not RITM), then you will need to glide the request record to update.
Try below script in your run script activity:
var reqGR = new GlideRecord("sc_request");
reqGR.get(current.getValue("request"));
reqGR.setValue("due_date", current.variables.desired_due_date);
reqGR.update();
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 11:01 AM
That resolved that issue but I guess I was mistaken in thinking my RITM and Task would inherit that due date from it. Is there a way to make them get the same due date from the user submitted one?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 11:08 AM
No, you will have to manually set it.
There are business rules to copy propagate values but I think this field is particular to some catalog item, so better to keep it in workflow.
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 12:20 PM
That is correct. I am only worried about this particular catalog item. I want to know how to get the ritm and task to put the desired due date in as the due_date variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 12:25 PM
For RITM you can just simply put in run script or you can also use "Set Value" activity in workflow
current.due_date = current.variables.desired_due_date;
current.update();
For catalog task, when you are creating catalog task using "create catalog task" workflow activity, just add one line
task.due_date = current.variables.desired_due_date;
Aman Kumar