Expanding Profile Select Attribute in API

I’m retrieving two profile types (Person & Assignment) via the API, and I have a profile select attribute in the Assignment attributes that ties it to a Person, but it shows the display name (Person’s First & Last Name), and I am concerned if we have different people with the same name that when we try to associate the two, they will tie to each other when they are not really linked. Is there a way to expand the attribute via the API to get more details like the ID?

Thanks,

-Rik

Hi @brownric

Could you please provide API details with screenshots? This would help us understand it better.

Here’s the details of the attribute I want to expand:

Here’s the API Call for the profiles (Assignment) that I am pulling:

I want to get more details on the person_rr_assignment

Hi Ricardo,

The “name” of the profile is driven by the Profile Type naming convention set on the Profile Type configs.

I think your concern around the potential linking of the Assignment to the wrong user is valid in certain instances. On the other hand, I would be curious to see how you are handling/linking the Person/Assignment.

Finally depending on what you want to do with the data, you can reference profile attributes from person_rr_assignment within NERM. Example would be: person_rr_assignment.first.id or person_rr_assignment.first.assignment_end_date_ne_attribute

I have an Update Profile Workflow (On Person Profile Type) that launches a Create Assignment Workflow and I am sending the Person Profile into the person_rr_assignment field for the workflow.

@coltonulmer - Do you have an example of the API call on how to reference profile attributes in the API?

This is helpful.

Could you help me understand and clarify the ask, do you want to execute an API request to determine IF the user has an existing assignment(s)? or something else?

Just want to make sure I do not push you in a wrong direction.

Thanks!

For example, here is a request I make to determine if the User has an Active Assignment for the Role and Location selection

Request Type: POST
URL: https://{{base_url}}/api/advanced_search/run

{
 "advanced_search": {
 "condition_rules_attributes": [
 {
 "type": "ProfileAttributeRule",
 "condition_object_id": "##########", //Assignment Identity attribute id
 "object_type": "NeAttribute",
 "comparison_operator": "include?",
 "value": "{{profile.id}}"
 },
  {
 "type": "ProfileAttributeRule",
 "condition_object_id": "##############",//Location attribute id
 "object_type": "NeAttribute",
 "comparison_operator": "include?",
 "value": "{{request.location_ne_attribute.first.id}}"
 },
   {
 "type": "ProfileAttributeRule",
 "condition_object_id": "######", //Assignment Role
 "object_type": "NeAttribute",
 "comparison_operator": "==",
 "value": "####" //Assignment Role ID
 },
 {
 "type": "ProfileTypeRule",
 "comparison_operator": "==",
 "value": "{{assignment profile type id}}"
 },
 {
 "type": "ProfileStatusRule",
 "comparison_operator": "==",
 "value": "Active"
 }
 ]
 }
}

The important thing to note, is you can reference Profile AND request attributes within the REST API workflow action in NERM.

1 Like

Could you help me understand and clarify the ask, do you want to execute an API request to determine IF the user has an existing assignment(s)? or something else?

Thank You for your responses, hopefully this clarifies what I am trying to achieve.

I want to execute an API to retrieve the Profiles to for the Assignment Type and inside those profiles, is a Attribute Named person_rr_assignment (which is a Profile Select Attribute, that links the Assignment Profile that is being created to a Person Profile) and right now when I do the call “{{URL}}/profiles?profile_type_id=a98fa8ec-c64f-4218-b718-86aecb3fe90f”, the attribute just comes back with the Display Name of the record.

Due to the size of our organziation, we get a lot of people with the same first and last name (Which is the current display name of the Person Profile), and would not be able to ensure that correct Person Profile to Assignment Profile relationship would be accurate when two different people have the same name.

Thanks for the clarification! In my mind, the simplest and most effective solutions to this:

  • Change the Profile Naming convention to include a distinguishing factor (i.e. email userID etc)
    AND/OR
  • Save the Identity/User ID to the assignment that is created, to determine who it belongs to.

The API/platform will only show what is configured in the Profile Naming convention for the profile type (Identity/Assignment) for that profile attribute.

If you want to execute a query for a specific user and assignment within a workflow. You could do something similar to the example I posted above.

Hopefully I didn’t lead you too astray and perhaps shined a light on some possibilities.

1 Like

You can get an attribute setup for the person’s id in the assignment by doing the following:

  • Create an attribute (text_field) called like person_profile_id
  • add a rest api action call after the create action in the workflow that you are creating the assignment to populate that person_profile_id
  • the rest api call would be like:

Method: patch
Endpoint: {{ base_url }}/api/profiles/{{ profile.id }}

Body:

{ “profile”: {

“attributes”: {

“person_profile_id”: “{{ attribute.person_rr_assignment.first.id }}”
}
}

Hope this helps!

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.