Record Producer
- Verify Manager and Auto-populate 'Requested For' field
One of the complaints Amanda has had is sometimes the requestors don't have a manager listed or if there is one listed, it's the wrong one. This results in a delay of approval and ultimately a poor experience for the requestor.
The solution we've decided on is to list the requestors manager on the record producer, so they can either leave it or change it or fill it in.
This will require a new field on the telework table, changing some of the record producer questions, a script to auto populate a 'requested for' field, and using the 'Auto Populate' section on the record producer. Sounds like a lot, but it will go quickly.
Here are our steps:
➊ | Create 2 new fields on the telework case table called "Manager" and "Requested For" |
➋ | Create a new question on the record producer for "Manager" and "Requested For" |
➌ | Create a script to auto-populate the 'Requested For' with the logged in user name using design studio |
➍ | Change the flow to work with these new fields |
Creating 2 new fields on the telework case table called "Manager" and "Requested For"
In app engine studio in the Telework Case application:
Open Telework Case Data Table (not shown) Click Fill in these fields:
➊ Column label Manager ➋ Type Reference ➌ Table to reference User (sys_user) ➍ Click Now, add a new field called 'Requested For' using the same steps and these attributes:
➊ Column label Requested For ➋ Type Reference ➌ Table to reference User (sys_user) ➍ Click Let's add it to the workspace form
Click 'Forms' (center at the top, to the right of 'Data') Change 'Default view' to 'Workspace Telework' Add the new fields to the form
➊ Manager ➊ Requested For ➋
Great – you now have a new field called 'Manager' and 'Requested For' and they're on your workspace form.
Next, we'll add 2 new questions to our record producer
Go back to your App Home for Telework Case Management and open the Experience, 'Apply for Telework – record producer':
Once it opens up, choose:
- Questions
- Delete the Question Set – 'Standard Employee Questions'
- After clicking on the 'x' click on 'Remove'
Next, we'll add in the question to find out who they are requesting the telework arrangement for – this will give the teams flexibility for people to request on behalf of someone else which has also been something the teams have been requesting be added to the form.
Insert a new question
Click 'Insert New Question' Question Type Choice Question subtype Reference Mape to a specific field on the table True Table field Requested for Question label Who is this arrangement for? Click tab 'Continue to Additional details' Source Table User (sys_user) no conditions Click 'Insert question' (bottom right) Move this question to the top of form, it should now look like this:
Next we need to confirm we have the right manager
We'll add the manager question to this form and populate it based off of who they have in the 'requested for' question.
Next, insert a new question
Click 'Insert New Question' Question Type Choice Question subtype Reference Mape to a specific field on the table True Table field Manager Question label Manager Click tab 'Continue to Additional details' Source Table User (sys_user) no conditions Click tab 'Auto-populate Fill out the form ➊ Select the question this depends on 'Who is this arrangement for? sys_user ➋ Use the data pill picker button on the right ➌ Scroll to 'Manager' Click tab 'Annotation'
Fill out the form Show instructions true Instructions If this is the correct manager don't change. If it is empty or the wrong manager, please change. The approval for your telework request will go to this person. Click button
Bonus: on your own, add a behavior to the 'Manager' question so it's mandatory if it's empty!
Move the 'Manager' question so it's the 2nd question, should look like this now:
Click Click Click And you're here:
Next, we want to auto-populate the 'Requested For' question with whomever is filling out the form. To do that, we need to go into design studio, find the variable and add it to the default tab with one line of code.
We need to do this part in the Dev Studio
To get to the Dev Studio:
- Click on the 'cog' in the upper right
- Click on 'open app in Dev Studio'
You should be here:
On the left hand navigation are all the application files we've created so far in our Telework Case application.
Scroll on the left to find
Service Catalog
Record Producer
Apply for Telework – click on 'apply for telework' record producer
This is your record producer platform default view.
Scroll down to the related lists, 'Variables'.
Click on the variable 'who is this arrangement for?'
➊ Scroll to 'Default Value' tab ➋ paste: javascript:gs.getUserID() ➌ Click on 'Update' (choose your button of choice) After updating, it stays on this tab.
We're all done with the Design studio, you can close this browser tab and go back to the your Telework App home.
At this point
➊ we've updated the data table with 2 new fields: 'Manager' and 'Requested For'➋ modified the record producer experience
➌ created a script to auto-populate the 'Requested For' with the logged in user name using design studio
All that's left to do now is update the flow so it takes advantage of our new fields.
Remember, we're relying on the 'requested for' field now, not the 'opened by' since sometimes they could be different.
Changing the flow to work with these new fields
(not shown)
- Click on 'Logic and automation'
- Open the 'Main' flow (switch to tree view) so you should be here now:
2 things we need to change:
- Ask For Approval – change this to the 'manager' field
- Send Email – send the email to the email of the 'requested for'
Changing Approval
Steps ➊ Expand Step 6 - 'Ask for Approval' ➋ Clear the box after 'Anyone Approves' ➌ Click on the data pill picker to find the 'Manager' field ➍ trigger - Record Created - Telework Case Record - Manager Click on
Send Email – send the email to the email of the 'requested for'
Steps ➊ Expand Step 11 - 'Send Email' ➋ Clear the 'To' field ➌ Click on the data pill picker for the 'To' field ➍ trigger - Record Created - Telework Case Record - Requested For - Email Click on
Are there any other fields you need to change? Sometimes people use the opened_by name in the email body, if you did – be sure to change that up as well.
Almost done, need to do 1 more thing:
Activate (this also saves it)
(that's actually 2 things)
Now, you can test it and make sure you're good to go –
Open up Service Portal
Fill out Apply for Telework
If you change the 'Requested For' field does the manager change?
- If the manager is blank, it means the person doesn't have a manager listed
- Does the rest of the form work right?
- Submit Go to the Telework workspace
Check the new telework form- Is the manager field correct?
- Is the requested for field correct?
- After the approval, does the email go to the right person?