- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 10:04 AM
I have created the following Catalog Item and Form. The idea is for the Training group to fill this form out for new employees.
Currently the Employee Name field will auto populate all of the required fields.
using the following Client Script:
When I get to the Request and Requested Item, the name that is populated as the Requested for is mine.
So I went back to the form, and added the Requested By Variable Set which of course will not populate the needed fields.
My question is to have one of the following occur:
1. Keep the Employee name field which will populate everything as it is now, but also have the name inserted there be the Requested for
2. Change the variable from Employee_name to Requested_for, have it populate all fields and show as the Requested for.
Either option is good for me.
Thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2016 08:14 AM
I figured it out.
I needed to change the field name from employee_name to requested_for.
Then in the Client Script I did the same
This would give me the functionality that I needed.
1. to Auto Populate the Fields I needed.
As well as Bring forward the Employee Name as my Requested for in the Request. RITM and the SCTASK
Thanks everyone for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 10:18 AM
When it comes to request items, variables don't auto-magically do anything in determining requested for.
If I want to precision control this, I typically do so in a Run Script in the very first activity of whatever workflow I'm firing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 10:26 AM
I understood that it would not do it automatically, I guess my request is for someone to assist with the framework of what that script would look like.
OR
Explain to me how to get my Employee Name variable to populate the Requested for Field in the Req, RITM and SCTask
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 10:30 AM
Well, OOB the Requested For field doesn't exist in RITM or SC_Task. It only exists at Request.
So the script within the workflow would look something like this...
current.parent.requested_for = current.variables.employee_name (or whatever you called it)
When running scripts inside a workflow, current is always your Requested Item. From there you need to dot walk up parent to get to the Request, then adjust the Request's "requested_for" field. As a neat side effect, Opened_By will always keep track of "who actually hit save".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 11:09 AM
I am not sure as to where exactly to put this.
Can you take a screen shot of how you would place it? Sorry for the bother, just want to make sure that I get it correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 11:11 AM
In the workflow builder, open the Workflow that the Requested Item would trigger, add a "Run Script" activity just after the Begin activity, then place the script I wrote you. Make sure your activities are linked up nicely and you're good to go.