cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vsolanon
Helper III
Helper III

Get AD Azure attribute based on Person selected

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 🙂

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

 

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-xida-msft !! 🙂 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,789)