…thoughts on ServiceNow and digital transformation

Post

ServiceNow HRSD: Updating HR Tasks or HR Cases with Employee Forms


A common requirement in HRSD is to have an Employee Form (Collect Employee Input HR Task) update the HR Task it is associated with or even the HR Case that the HR Task is related to. While you can add mappings to fields from the Employee Form fields, these mappings basically only work for HR Profiles, which isn’t so useful. Filipe Cruz has a nice article on how to do this by modifying an Employee Center script include. While this solution works well, it involves customizations which means skips during upgrades of the Employee Center store application. Below is an alternative solution that uses a sub flow to retrieve the values of the Employee Form and then write it to the HR Case. This solution will create an HR Task of the type Collect Employee Input, asking the employee if they will attend the holiday party. It will then update a holiday part attendance field on the HR Case.

Note that this solution only works for HR Tasks created from the sub flow itself (which is usually triggered from a UI Action); it doesn’t work for HR Tasks that are manually created.

Sub Flow

1. Create a sub flow with an reference input to the COE, here this is pointing to the HR Total Rewards Case table

    2. Step 1 is to Create the HR Task record. Be sure to check the Wait checkbox.

    3. Step 2 is a Look Up Record on the asmt_metric_result table. This table contains the Employee Form data that was filled out. There is a record for each question in the Employee Form so if your Employee Form has multiple questions that you want to update the case with, you have to do a Look Up Record for each one.

    Instance – Dot walk to the HR Task created in the previous step of the flow, the Survey Instance field.

    Metric – This is the question in the Employee Form.

    4. Step 4 updates the HR Case (sub flow input) with the value in the String Value field on the asmt_metric_result record that was found in the previous step.

    5. If you want to trigger the sub flow from a UI Action, publish the Flow and go to Create Code Snippet. Use this code for the UI Action. Otherwise, you can trigger the sub flow from a flow.