---
sourceDocument: Australia Employee Service Management
sourceDocumentLink: https://www.servicenow.com/docs/r/pt-BR/employee-service-management

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Employee Service Management

ft:clusterId :

    - emplsm

bundleId :

    - emplsm

workflow :

    - Employee


---

# Create a requirement for potentially exposed contacts to return to work

# Create a requirement for potentially exposed contacts to return to work {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 min. de leitura

Create a requirement for potentially exposed employees to meet to verify that they
are eligible to return to work.

## Antes de Iniciar

* Health and safety requirements are available in the ServiceNow® Employee Readiness Core application, which must be installed.
* Health and safety requirements are built with ServiceNow® Workflow Studio, so make sure you're familiar with the [Flow Designer](https://www.servicenow.com/docs/access?context=flow-designer&version=australia&pubname=australia-application-development&ft:locale=en-US) basics.

{#create-exposed-contacts-requirement__ul_g1f_crj_kmb}

Role required: sn_imt_core.admin

## Por Que e Quando Desempenhar Esta Tarefa

Define health and safety requirements for employees to return to work. Employees should not be in any potentially exposed contacts investigation of a case. If they are part of an active case investigation, they should meet the requirement of a clear status to be eligible to return to workplace. For more information, see [Follow up with potentially exposed contacts](https://www.servicenow.com/docs/nSOu02sjsp18S8A_T39xhw "As a case task owner, contact potentially exposed users to follow up on their health status using the predefined instructions and survey questions.").  
Nota:  
This procedure describes how to create a requirement using the base system
Exposed Contacts Requirement as an example.

## Procedimento

1. In Workflow Studio, create an action to add or update the requirement status for an employee added to the potentially exposed contacts list of a case.
   1. Create an action and save it in the Employee Readiness Core application.
   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.  
      For example, to meet the Exposed Contacts Requirement, employees must
      have a record in the Exposed Contacts table
      \[sn_imt_tracing_exposed_contact\].
      {#create-exposed-contacts-requirement__table_up4_byt_zlb__entry__4}

      | Label | Name | Type | Mandatory |
      |-|-|-|-|
      | Exposed Contact | exposed_contact | Reference.Exposed Contacts \[sn_imt_tracing_exposed_contact\] | Yes |
      [ ]

      {#create-exposed-contacts-requirement__table_up4_byt_zlb}
   3. Add a Script Step to the Action Outline.
   4. In the Required Runtime field, select Instance.
   5. Create an input variable using the input that you created for the action as the value.  
      This variable enables you to use the input for the action in a
      script.
      {#create-exposed-contacts-requirement__table_yyf_ld5_zlb__entry__2}

      | Name | Value |
      |-|-|
      | exposed_contact | Exposed Contact input that you created in the Inputs section. |
      [Tabela 1. Input Variables]

      {#create-exposed-contacts-requirement__table_yyf_ld5_zlb}
   6. In the Script field, add a script to define the conditions when an employee's requirement status is `cleared` or `not_cleared`.  
      For the Exposed Contacts Requirement, the requirement is `not
      cleared` for an employee if the health status in any
      exposed contact records for the employee is
      <kbd class="ph userinput">under_investigation</kbd> or
      <kbd class="ph userinput">infected</kbd>, and `cleared`
      for any other response.

          (function execute(inputs, outputs) {
            if(inputs.exposed_contact.status == 'under_investigation' || inputs.exposed_contact.status == 'infected'){
              outputs.requirement_status = 'not_cleared';
            }else{
            	outputs.requirement_status = 'cleared';
            }
          })(inputs, outputs);

          (function execute(inputs, outputs) {
            
            outputs.requirement_status = 'cleared'; 
            if (!inputs.exposed_contact.is_primary_exposed_contact) {
              var now_GR = new GlideRecord('sn_imt_tracing_exposed_contact');
              now_GR.addQuery('exposure_case.active',true);
              now_GR.addQuery('is_primary_exposed_contact',true);
              now_GR.addQuery('user',inputs.exposed_contact.user);
              now_GR.setLimit(1);
              now_GR.query();
              if (now_GR.next()) {
              	if(now_GR.status == 'under_investigation' || now_GR.status == 'infected'){    
              		outputs.requirement_status = 'not_cleared';  
            		}else{  	
              		outputs.requirement_status = 'cleared';  
            		}
              }else{
                var gr2 = new GlideRecord('sn_imt_tracing_exposed_contact');
                gr2.addQuery('exposure_case.active',true);
                gr2.addQuery('user',inputs.exposed_contact.user);
                gr2.query(); 
                while(gr2.next()){
                  if(gr2.status == 'under_investigation' || gr2.status == 'infected'){    
              		outputs.requirement_status = 'not_cleared';
                      break;
                  }
                } 
              }
            }else{
            	if(inputs.exposed_contact.status == 'under_investigation' || inputs.exposed_contact.status == 'infected'){    
              	outputs.requirement_status = 'not_cleared';  
            	}else{  	
              	outputs.requirement_status = 'cleared';  
            	}
            }
          })(inputs, outputs);

   7. Create an output variable for the requirement status.  
      This defines the <var class="keyword varname">requirement_status</var> variable that
      you used in the script.
      {#create-exposed-contacts-requirement__table_lxm_325_zlb__entry__5}

      | Label | Name | Type | Mandatory | Choice (Advanced options) |
      |-|-|-|-|-|
      | requirement_status | requirement_status | Choice | Yes | Dropdown with --None-- |
      [Tabela 2. Output Variables]

      {#create-exposed-contacts-requirement__table_lxm_325_zlb}
   8. In the Outputs section of the Action Outline, create an output for the requirement status.  
      Creating this output enables you to use the
      <var class="keyword varname">requirement_status</var> output variable from the
      script as an output returned by the action.
      {#create-exposed-contacts-requirement__table_n45_pc5_zlb__entry__5}

      | Label | Name | Type | Mandatory | Choice (Advanced options) |
      |-|-|-|-|-|
      | Requirement status | requirement_status | Choice | No | Dropdown with --None-- |
      [Tabela 3. Output Variables]

      {#create-exposed-contacts-requirement__table_n45_pc5_zlb}
   9. Assign the <var class="keyword varname">requirement_status</var> value to the output.  
      {#create-exposed-contacts-requirement__table_p2f_wo5_zlb__entry__2}

      | Label | Value |
      |-|-|
      | Requirement Status | <var class="keyword varname">requirement_status</var> output variable from the script step. |
      [Tabela 4. Output Variables]

      {#create-exposed-contacts-requirement__table_p2f_wo5_zlb}

      The action returns the value of the
      <var class="keyword varname">requirement_status</var> for the employee
      (`cleared` or `not_cleared`) as an
      output.
   10. Click Publish.
   {#create-exposed-contacts-requirement__substeps_lqn_iwt_zlb}
2. Create an exposed contacts requirement.
   1. Navigate to Employee Health and Safety StatusHealth and Safety Requirements.
   2. Click New.
   3. On the form, fill in the fields.  
      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 Not Cleared.
      {#create-exposed-contacts-requirement__table_wxk_x2n_2mb__entry__2}

      | Field | Description |
      |-|-|
      | Name | Unique name for the requirement. For example, <kbd class="ph userinput">Exposed Contacts Requirement</kbd>. |
      | Requirement flow | Flow to update the requirement status for a potentially exposed employee. Leave this field empty. You will return to the requirement record and fill in this field after you create the flow. |
      | Active | This field is read-only. Once you update all fields for the requirement, you can use the Activate button to activate the requirement. |
      | Default status | The default status assigned to employees who are not in the potentially exposed contacts list to meet the health and safety requirement. The options are Cleared and Not Cleared. For example, employees who don't have an exposed contact record are assigned a default status of Not Cleared for the Exposed Contacts Requirement. |
      | Use duration | Option 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 status of the exposed contact task for the employee is updated. |
      | Include previous applicable records ||
      | Table | Table to consult for previously created records that will trigger the requirement flow. For example, the Exposed Contacts Requirement uses the Exposed Contacts table \[sn_imt_tracing_exposed_contact\]. |
      | Condition | Conditions to filter the records from the table that will trigger the flow. |
      [Tabela 5. Health and Safety Requirement form]

      {#create-exposed-contacts-requirement__table_wxk_x2n_2mb}
   4. Click Submit.
   {#create-exposed-contacts-requirement__substeps_ret_mm5_zlb}
3. In Workflow Studio, create a flow to update the requirement status for an employee.
   1. Create a flow and save it in the Employee Readiness Core application.
   2. Add a trigger so that the flow runs whenever the type of record that you're using to check the requirement status is created or updated.  
      For example, for the Exposed Contacts Requirement, the flow runs
      whenever an exposed contacts record in a case is created or
      updated.
      {#create-exposed-contacts-requirement__table_j2h_lh5_zlb__entry__4}

      | Trigger | Table | Condition | Run Trigger |
      |-|-|-|-|
      | Created or Updated | Exposed Contacts \[sn_imt_tracing_exposed_contact\] | None. | Once |
      [Tabela 6. Trigger]

      {#create-exposed-contacts-requirement__table_j2h_lh5_zlb}
   3. Add the action that you created to the flow, with the record from the trigger as the input.  
      For example, for the Exposed Contacts input, add the Exposed Contacts record that was created or updated in the trigger event.
   4. Add the Update User Requirement action provided in Employee Readiness Core to the flow.  
      {#create-exposed-contacts-requirement__table_ncn_xl8_zlb__entry__4}

      | User \[User\] | Health and safety requirement \[Health and Safety Requirement\] | Requirement status | Trigger datetime |
      |-|-|-|-|
      | Employee or User field from the trigger record. For example, the User field from the Exposed Contacts record. | Health and safety requirement you created for the potentially exposed contacts. | `requirement_status` returned by the action you created. | Select Date/Time. |
      [Tabela 7. Update User Requirement inputs]

      {#create-exposed-contacts-requirement__table_ncn_xl8_zlb}
   5. Click Activate.
   {#create-exposed-contacts-requirement__substeps_epf_io5_zlb}
4. Complete the health and safety requirement.
   1. Navigate to Employee Health and Safety StatusHealth and Safety Requirements.
   2. Click the requirement.
   3. In the Requirement flow field, add the flow that you created to update the requirement status for employees.
   4. Click Update.
   {#create-exposed-contacts-requirement__substeps_nyu_3wt_zlb}

## O que Fazer Depois

You must activate the requirement before you can track whether employees have
fulfilled it. For instructions, see [Activate a health and safety requirement](https://www.servicenow.com/docs/UxrALUFzMat7wSgaBo33Dw "Activate requirements to track when employees are ready to return to the workplace or to safely travel to another site. You can also activate requirements that visitors must complete before entering the workplace.").

