Skip to main content

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"

  1. In app engine studio in the Telework Case application:

    OpenTelework Case Data Table (not shown)
    Click+ Add field

  2. Fill in these fields:

    Column labelManager
    TypeReference
    Table to referenceUser (sys_user)
    ClickAdd

  3. Now, add a new field called 'Requested For' using the same steps and these attributes:

    Column labelRequested For
    TypeReference
    Table to referenceUser (sys_user)
    ClickAdd

  4. 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'

  5. Add the new fields to the form

    Manager
    Requested For
    Save

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:

  1. Questions
  2. Delete the Question Set – 'Standard Employee Questions'
  3. 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.

  1. Insert a new question

    Click'Insert New Question'
    Question TypeChoice
    Question subtypeReference
    Mape to a specific field on the tableTrue
    Table fieldRequested for
    Question labelWho is this arrangement for?

    Click tab'Continue to Additional details'
    Source TableUser (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.

  1. Next, insert a new question

    Click'Insert New Question'
    Question TypeChoice
    Question subtypeReference
    Mape to a specific field on the tableTrue
    Table fieldManager
    Question labelManager

    Click tab'Continue to Additional details'
    Source TableUser (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 instructionstrue
    InstructionsIf 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 buttonInsert Question

Bonus: on your own, add a behavior to the 'Manager' question so it's mandatory if it's empty!

  1. Move the 'Manager' question so it's the 2nd question, should look like this now:

    ClickReview and submit
    ClickSubmit
    ClickReturn to my application

    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:

  1. Click on the 'cog' in the upper right
  2. 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.

  1. 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.

  1. Scroll down to the related lists, 'Variables'.

  2. 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:

  1. Ask For Approval – change this to the 'manager' field
  2. Send Email – send the email to the email of the 'requested for'
  1. 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 Done


  1. 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 Done

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?

That's it!!

If you need to change how variables respond, use the dev studio and there's always a place for scripting – whether it's just one line of code or something more complex that uses a script include, it's all there. (That's also a place where GenAI will help speed things up!)