web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get AD Azure attribute...
Power Apps
Answered

Get AD Azure attribute based on Person selected

(0) ShareShare
ReportReport
Posted on by 146

Hellos Experts,

 

I am building a PowerApps for our HRs to request trip letters. The application is connected to a SharePoint list where I have one person column named "Employee". The user will need to enter in the PowerApps and submit a form to request a letter.

 

In the field "Employee", each HR will search and select the name of the employee who will go on the trip. I am trying to populate (based on the employee selected) an ID we use in the company, which is not in the options populated in PowerApps. This is an attribute created by my company.

I already now the Azure AD attribute name of this ID, however, I do not know how to get this attribute from PowerApps.

 

I know how to get this attribute using Flow Automate (see below image), by selecting 1)User: Employees Claim and 2)Select field: the Azure AD attribute. However, this work only once I have saved the information into SharePoint. 

In my case, I need to get the attribute at the time the employee is filling the form, which will be before submitting it into SharePoint.

 

GetUser.JPG

I was wondering if it was possible to get this information using the correct connector in PowerApps or if it was possible to trigger a Flow-based if the "Employee" field from PowerApps has information.

 

Thank you in advance! I really appreciate your support 🙂

 

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @vsolanon ,

    Do you want to get the custom attribute of a AD User in your canvas app?

     

    Based on the needs that you mentioned, I agree with you, if you want to get the custom attribute of a AD User in your canvas app, I afraid that there is no way to achieve your needs.

     

    As an fixed solution, you could consider fire a flow from your canvas app when you select an Employee option within the Employee ComboBox in your Edit form.

     

    I have made a test on my side, please try the following workaround:

    Flow's configuration should be like below:

    3.JPG

     

    Then within your canvas app, you should add a connection to above flow firstly, then set the OnChange property of the Employee ComboBox in your Edit form to following:

    Set( // save the retrieve AD Attribute value returned from your app into a variable
     AD_Attribute, 
     'Your Flow Name'.Run(EmployeeComboBox.Selected.Email).result
    )

    then you could reference the AD Attribute value of the selected Employee option through the AD_Attribute variable in your app.

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

  • vsolanon Profile Picture
    146 on at

    Hello @v-xida-msft  thank you very much! I test it and it works as expected 🙂

     

    My only question will be how I can reset this field after the user submits the request?

    In the EditForm I have a second field named "IDNumber", and I included the AD_Attribut variable inside the Default property of this field. 

    After the user creates a new form and selects an employee, the Flow runs and the IDNumber filed is updated with the ID of the employee. However, after the EditForm is submitted and the user creates a second (new) request, I noticed the IDNumber field still has the ID found in the previous search.

     

    I tried by adding an IF in the default property of the IDNumber, however, it did not fix it.

     

    Thank you in advance!

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @vsolanon ,

    Does the solution I provided above achieve your original issue?

     

    If the solution I provided above could achieve your original issue, please consider go ahead to click "Accept as Solution" to identify my reply as Solution.

     

    For your current issue, if you want to reset the IDNumber filed after you submit your Edit form data, please try the following workaround:

    Set the OnSuccess property of the Edit form to following:

    Set(AD_Attribute, Blank()); // clear this AD_Attribute variable here
    Back()

     

    Please try above solution, check if the issue is solved.

     

    Best regards,

  • vsolanon Profile Picture
    146 on at

    Thank you @v-xida-msft !! 🙂 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard