{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":9350,"path":"employee-service-management/contact-tracing/create-privacy-consent-requirement.md","title":"Create a requirement for employees to acknowledge the privacy consent request","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a requirement for employees to acknowledge the privacy consent request\n\nCreate a requirement for your employees to respond to the privacy consent request before entering the workplace to facilitate the use of their data for contact tracing.\n\n## Before you begin\n\n-   Requirements are available in the ServiceNow® Employee Readiness Core application, which must be installed.\n-   Privacy Consent requirement is built with ServiceNow® Workflow Studio, so make sure you're familiar with the [Flow Designer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/application-development/flow-designer.md) basics.\n\nRole required: sn\\_imt\\_core.admin\n\n## About this task\n\nDefine the privacy consent requirement for employees to return to work. Employees who agree to the use of their data for contact tracing fulfill the privacy consent requirement and are eligible to return to the workplace. Employees who disagree do not fulfill the privacy consent requirement and are not eligible to return to the workplace. For more information, see [Respond to a request for privacy consent in Contact Tracing](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/contact-tracing/submit-privacy-consent.md).\n\n**Note:** This procedure describes how to create a requirement using the base system Privacy Consent Requirement as an example.\n\n## Procedure\n\n1.  In Workflow Studio, create an action to add or update the requirement status for an employee who responds to the privacy consent request.\n\n    1.  Create an action and save it in the Employee Readiness Core application.\n\n    2.  In the Inputs section of the Action Outline, create an input for the type of record to use to check whether the employee meets the requirement.\n\n        |Label|Name|Type|Mandatory|\n        |-----|----|----|---------|\n        |preference|preference|String|Yes|\n\n    3.  Add a **Script Step** to the Action Outline.\n\n    4.  In the **Required Runtime** field, select **Instance**.\n\n    5.  Create an input variable using the input that you created for the action as the value.\n\n        This variable enables you to use the input for the action in a script.\n\n        |Name|Value|\n        |----|-----|\n        |preference|**preference** input that you created in the Inputs section.|\n\n    6.  In the **Script** field, add a script to define the conditions when an employee's requirement status is `cleared` or `not_cleared`.\n\n        For the Privacy Consent Requirement, the requirement is `not_cleared` for an employee if the employee disagrees to the privacy consent request, and `cleared` if the employee agrees.\n\n        ```\n        (function execute(inputs, outputs) {\n            if (inputs.preferences == \"agree\") {\n                outputs.requirement_status = \"cleared\";\n            } else if (inputs.preferences == \"withdraw_consent\") {\n                outputs.requirement_status = \"not_cleared\";\n            }\n        \n        })(inputs, outputs);\n        \n        ```\n\n    7.  Create an output variable for the requirement status.\n\n        This output variable defines the *requirement\\_status* variable that you used in the script.\n\n        |Label|Name|Type|Mandatory|Choice \\(Advanced options\\)|\n        |-----|----|----|---------|---------------------------|\n        |requirement\\_status|requirement\\_status|Choice|Yes|Dropdown with --None--|\n\n    8.  In the Outputs section of the Action Outline, create an output for the requirement status.\n\n        Creating this output enables you to use the *requirement\\_status* output variable from the script as an output returned by the action.\n\n        |Label|Name|Type|Mandatory|Choice \\(Advanced options\\)|\n        |-----|----|----|---------|---------------------------|\n        |Requirement status|requirement\\_status|Choice|No|Dropdown with --None--|\n\n    9.  Assign the *requirement\\_status* value to the output.\n\n        |Label|Value|\n        |-----|-----|\n        |Requirement Status|*requirement\\_status* output variable from the script step.|\n\n        The action returns the value of the *requirement\\_status* for the employee \\(`cleared` or `not_cleared`\\) as an output.\n\n    10. Click **Publish**.\n\n2.  Create a privacy consent requirement.\n\n    1.  Navigate to **Employee Health and Safety Status** &gt; **Health and Safety Requirements**.\n\n    2.  Click **New**.\n\n    3.  On the form, fill in the fields.\n\n        The Include previous applicable records section defines a set of records that have already been created but should still trigger the requirement flow. Including previous records ensures that employees who complete the requirement before it is activated have their requirement status set to Cleared.\n\n<table id=\"table_wxk_x2n_2mb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nUnique name for the requirement.\n\n</td></tr><tr><td>\n\nRequirement flow\n\n</td><td>\n\nFlow to update the requirement status for an employee. Leave this field empty. You will return to the requirement record and fill in this field after you create the flow.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nThis field is read-only. Once you update all fields for the requirement, you can use the **Activate** button to activate the requirement.\n\n</td></tr><tr><td>\n\nDefault status\n\n</td><td>\n\nThe default status assigned to employees who don't have any activity towards completing the requirement. The options are Cleared and Not Cleared.For example, employees who don't have a record in the User Privacy Notice and Consents \\[sn\\_imt\\_tracing\\_user\\_privacy\\_consent\\] table are assigned a default status of Not Cleared for the Privacy Consent Requirement.\n\n</td></tr><tr><td>\n\nUse duration\n\n</td><td>\n\nOption for setting a time limit for the validity of the requirement status.Do not select this field because the employee's status is automatically updated when the employee responds to the privacy consent request.\n\n</td></tr><tr><td colspan=\"2\">\n\nInclude previous applicable records\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\nTable to consult for previously created records that will trigger the requirement flow.For example, the Privacy Consent Requirement uses the User Privacy Notice and Consents table.\n\n</td></tr><tr><td>\n\nCondition\n\n</td><td>\n\nConditions to filter the records from the table that will trigger the flow.\n\n</td></tr></tbody>\n</table>    4.  Click **Submit**.\n\n3.  In Workflow Studio, create a flow to update the requirement status for an employee.\n\n    1.  Create a flow and save it in the Employee Readiness Core application.\n\n    2.  Add a trigger so that the flow runs whenever the type of record that you're using to check that the requirement status is created or updated.\n\n        For example, for the Privacy Consent Requirement, the flow runs whenever a user privacy notice and consent record is created or updated.\n\n        |Trigger|Table|Condition|Run Trigger|\n        |-------|-----|---------|-----------|\n        |Created or Updated|User Privacy Notice and Consents \\[sn\\_imt\\_tracing\\_user\\_privacy\\_consent\\]|\\[Preferences\\] \\[changes to\\] \\[I Agree\\] OR \\[Preferences\\] \\[changes to\\] \\[Withdraw Consent\\]|Only if not currently running|\n\n    3.  Add the action that you created to the flow, with the record from the trigger as the input.\n\n        For example, for the preference input, add the User Privacy Notice and Consent record that was created or updated in the trigger event.\n\n    4.  Add the Update User Requirement action provided in Employee Readiness Core to the flow.\n\n        |User \\[User\\]|Health and safety requirement \\[Health and Safety Requirement\\]|Requirement status|Trigger datetime|\n        |-------------|---------------------------------------------------------------|------------------|----------------|\n        |**User** field from the trigger record. For example, the **User** field from the User Privacy Notice and Consent record.|Health and safety requirement you created for the privacy consent.|`requirement_status` returned by the action you created.|Leave the field blank.|\n\n    5.  Click **Activate**.\n\n4.  Complete the health and safety requirement.\n\n    1.  Navigate to **Employee Health and Safety Status** &gt; **Health and Safety Requirements**.\n\n    2.  Open the Privacy Consent Requirement record.\n\n    3.  In the **Requirement flow** field, add the flow that you created to update the requirement status for employees.\n\n    4.  Click **Update**.\n\n\n## What to do next\n\nYou must activate the requirement before you can track whether employees have fulfilled it. For instructions, see [Activate a health and safety requirement](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/employee-readiness-core/activate-readiness-requirement.md).\n\n**Parent Topic:**[Setting up Contact Tracing](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/contact-tracing/set-up-contact-tracing.md)\n\n"}}