2.2 Add fields
Overview
Earlier, you created the back-end form the fulfiller users will see for records on the Telework Case
table. In this exercise, you will create the front-end form with questions for the user to answer when submitting the form.
The fulfiller users have requested that the Record Producer ask the requester the following questions from the PDF form we are digitizing:
- Who is the request for?
- Should auto-populate with the name of the current user, but can be edited to a different user.
- When do you need this?
- Options should be:
- Today
- Tomorrow
- This week
- Next Week
- Options should be:
- What type of Telework are you applying for?
- Options should be:
- Regular and Recurring Telework
- Remote Telework
- Situational Telework
- Options should be:
- Number of Days per Week?
- Input should only be an integer. No letters allowed.
- This field should only appear if the answer to the previous question is 'Situational Telework'.
- What is the reason for Teleworking?
- Options should be:
- Dependent Care
- Medical
- Reasonable Accommodation
- Options should be:
Instructions
A Question set is a ServiceNow term for a set of questions that can be re-used across multiple Record Producers and Catalog Items. Some questions in the set might have special logic to validate input or auto-populate answers.
The first two questions you will add to your Record Producer already exist on the system as part of a Question set called 'Standard Employee Questions'.
- Who is the request for?
- When do you need this?
- Add the 'Standard Employee Questions' Question set.
- Click the arrow next to .
- Click 'Question set'.
- Type
Standard
. - Click on 'Standard Employee Questions'.
- Click the arrow to the left of 'Standard Employee Questions' to expand the Question set and see what questions it contains.
Advanced ServiceNow users may know Questions sets outside of App Engine Studio by a different name 'Variable sets'.
Questions remaining to add:
Who is the request for?When do you need this?- What type of Telework are you applying for?
- Number of Days per Week?
- What is the reason for Teleworking?
Add the question 'What type of Telework are you applying for?'
- Click
- Configure the following values:
Field Name Field Value Question type: Choice Question subtype: Record reference - Scroll down to the Details section.
- Configure the following values: (💡 double-click, copy & paste into the form).
Field Name Field Value Map to a specific field Checked Table field choose Arrangement Question label What type of Telework arrangement are you applying for? Mandatory Checked Question Preview Notice on the right panel, then Question Preview shows what the question will look like to the user. infoNotice the Question Preview that shows what the question will look like to the user.
Click
.Type
Arrangement
the Source table box and click 'Arrangement' in the drop-down.Click on the Annotation tab.
In the current process with the PDF, the team is spending a lot of time correcting and manually re-routing Telework requests due to people confusing the different types of Telework arrangement.
Add an annotation to help the users understand what they are selecting.Check the box Show instructions.
Open the file:
telework_form_annotation.docx
.Copy all the text in the file ( ⌘ Cmd or CTRL+A, CTRL+C )
Paste it into the Instructions box (⌘ Cmd or CTRL+V ). You can choose to either keep or remove formatting.
Click
.
- Click
Questions remaining to add:
Who is the request for?When do you need this?What type of Telework are you applying for?- Number of Days per Week?
- What is the reason for Teleworking?
Add the question 'Number of Days per Week?' using a different way.
- Click below the last question you added.
- Click the 'New question' tile.
- Set the following values in the Type section:
Field Name Field Value Question type Text Question subtype Single line Scroll down to the Details section.
In the Details section, enter the following information: (💡 double-click, copy & paste into the form).
Field Name Field Value Map to a specific field Checked Table field Days per week Question label Number of Days per Week? Name days_per_week - Click on Additional details.
- Click on the Text validation drop-down and select Number.
- Click .
The Telework Case fulfillers want 'Number of days per week' to only appear if the user answers 'Situational Telework'...
This can be done with a Behavior.
Advanced ServiceNow users may know Behaviors outside of App Engine Studio by a different name 'UI Policies'.
Define a behavior for "Number of Days per Week?".
Hover over the question 'Number of Days per Week?'.
On the right side of the row, click this button.
Click
In the Actions tab, we'll specify the behavior we need:
Field Name Field Value Make the question mandatory Yes Make the question visible Yes - Click on the Conditions tab.
- Set the Dynamic Behavior Condition filter to
arrangement is Situational Telework 7. Click
.
This will create a UI effect where the "Number of Days per Week" field will only appear when the answer to "What type of Telework arrangement are you apply for?" is "Situational Telework".
Questions remaining to add:
Who is the request for?When do you need this?What type of Telework are you applying for?Number of Days per Week?- What is the reason for Teleworking?
Add the final question: What is the reason for Teleworking?
- Click .
- In the Type section set the following values:
Field Name Field Value Question type Choice Question subtype: Record reference Scroll down to the Details section.
In the Details section, enter the following information: (💡 Copy & paste into the form).
Field Name Field Value Map to a specific field Checked Table field Justification Question label What is the reason for Teleworking? Name justification Mandatory Checked Click
.Type
just
the Source table box and click 'Justification' in the drop-down.Click
.
Your screen should now look like this:
- Click .
Exercise Recap
The Record Producer form now has the required fields and behavior added to it. You were able to leverage a 'Question set' so that you did not have to recreate the Standard Employee Questions.