Expand my Community achievements bar.

Reporting or Filtering users based on Secondary Job Role

Avatar

Level 1

Hello friends,

I am configuring a Typeahead field with User as reference object. I want to pull users whose Primary Role = X or  Secondary Role= X. I see in the filter, I am able to pull users with Primary role=X using below

roleID=X
roleID_Mod=in

trying how do I pull those with Secondary role=X.

Appreciate any support.

 

Thanks

3 Replies

Avatar

Community Advisor

I can't figure out other/secondary job role and not seeing it in API Explorer. This is more roundabout, but you could have a column in your report that just shows all roles assigned and then you could use the in-report search to find the roles you're looking for? This would be the text mode for that column:

displayname=All Roles
listdelimiter=<p>
listmethod=nested(userRoles).lists
type=iterate
valuefield=role:name
valueformat=HTML 
If this helped you, please mark correct to help others : )

Avatar

Community Advisor

Did some digging and not sure if this is what you're after but may be helpful:

The standard Role ID field is only for the primary assignment. There isn’t a separate 1-to-1 field like “otherRoleID” for secondary roles that you can filter on in the same way. To include secondary ("other") job roles in reports, you need to use the Assignment Users or Assignment Roles collections in your filters. Those look at both primary and secondary assignments instead of just the primary roleID.
  • In the report builder, instead of filtering on Task >> Role ID, choose one of the collections such as Assignment Roles and then filter by the job role (name or ID). This will return tasks where that role is on the assignment list, regardless of whether it is primary or secondary.
  • Conceptually, any 1-to-1 fields (like assignedTo and roleID) are reserved for the primary assignment only; collections are what you use when you need to include secondary assignments as well.
If this helped you, please mark correct to help others : )

Avatar

Community Advisor

you'd pull in secondary roles using a collection. You can see in the API explorer in the collection tab, a collection of userRoles and when you click into that you can see the roleID in the userRole object. In your filter, it might look something like this:

 

userRoles:roleID=X
userRoles:roleID_Mod=in

 

as a best practice I would also filter out the deactivated users.