Content Audiences using HR Criteria for Secondary Positions

CelesteGro
Tera Contributor

We have employees who may hold up to 5 positions simultaneously. We built an HR Criteria based on the sn_hr_core_job table to filter employees by the company tied to each job & is an active user. In HR Criteria preview, this correctly returns all employees who have at least one job in that company.

 

However, when we add this HR Criteria to an Audience, it appears to evaluate only the user’s primary position and ignores the HR Criteria across other jobs.

 

Has anyone solved for this? 

2 REPLIES 2

SupriyaWaghmode
Mega Sage

Hi @CelesteGro  , 

 

You can use a group-based workaround.
  • Step 1: Create a dynamic User Group (e.g., "Employees with Jobs in Company X").
  • Step 2: Write a Business Rule or Flow Designer action on the sn_hr_core_job table. Whenever a job record is created, updated, or deactivated, evaluate if the user has any active jobs with Company X. If yes, add them to the group; if no, remove them.
  • Step 3: Base your HR Criteria or Audience directly on Group Membership, which evaluates perfectly every time.

If my response helped, please mark it as the accepted solution so others can benefit as well. 

 

Thanks & Regards ,

Supriya Waghmode 

sanjaygupta
Tera Guru

I couldn’t find documentation that says how an Audience evaluates HR Criteria across several jobs. What the documentation does show is that the HR Profile (sn_hr_core_profile) points to one primary job, while the Jobs table (sn_hr_core_job) holds all of them. That fits what you see: the Preview checks the Jobs table directly, while an Audience seems to work from the profile’s primary job. Please treat this as the likely cause, not a confirmed one.

Since HR Criteria applies to the HR profile, the safest way to cover all five positions is to put the answer on the profile itself:

  • Create a field on the HR Profile that holds the companies from all of a user’s active jobs, such as a List field to the Company table.
  • Fill it with a business rule or flow on sn_hr_core_job (insert, update, and delete). Keep it in a scoped app.
  • Include only jobs where the user is active.
  • Build a new HR Criteria on the HR Profile table with a condition on that field, such as it contains your company.
  • Replace the old criteria in the Audience with the new one.
  • Run the criteria Preview and test with a user whose second job is in the target company.

If you only have a few companies, a simpler option is one HR Criteria per company. HR Criteria on an Audience or service work as OR, so a user matching at least one of them is included. This doesn’t solve the secondary-job part by itself, though.

The Switch primary job subflow could change which job counts as primary, but it would shift the audience from one company to another, so it doesn’t fit your need.

Test in sub-production first and keep the changes in an update set. Don’t edit the out-of-box criteria or tables.

Sources: