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 / How to Assign particul...
Power Apps
Answered

How to Assign particular user from sharepoint list in power apps

(0) ShareShare
ReportReport
Posted on by 138

Hello Team,

We have two Sharepoint lists as Submitlist and Role list. We have created a form in power apps. The form has a field as Assigned To (person field from submitting list). Datasource is connected to Office 365 users. When we search for a User name in Assigned to it displays the name.

On items property: Choices([@'Submitlist'].'Assigned To') ---  displays all the user's names. That's working fine.

Now my requirement is --In the Role list --we have different fields(person) as Approver, Implementer, Rejecter, etc.

When we assign a user under Approver , then in the Assigned To field only that Approver Name should reflect,

For Example --In Role List -Under Approver --User Name As Sid. When i fill the form in the assigned to field Only Sid user name should appear. How can I achieve it?

I tried using this formulae

On items property: Choices([@'Rolelist'].'Implementer') --it does not work?

Any help very much appreciated.

 

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @Salesforce ,

     

    One thing you should know is that Person columns will hold all the users from O365, you just select one or more users in a column as the choice(s). So the Choices function means get all the choices from the Person column where you will always see all the users.

     

    For your scenario, I assume that in the Role list it holds Person columns named as Approver, Implementer, Rejecter, etc. . So first you need to get the user names based on the selected role:

     

    Switch(
     AssignedRoleComboBox.Selected.Value,
     "Approver",
     Distinct(
     Rolelist,Approver.DisplayName
     ).Result,
     "Implementer",
     Distinct(
     Rolelist,Implementer.DisplayName
     ).Result,
     "Rejecter",
     Distinct(
     Rolelist,Rejecter.DisplayName
     ).Result,
     "OtherRole",
     Distinct(
     Rolelist,OtherRole.DisplayName
     ).Result
    )

     

    Set above formula as Items of the Assigned To combo box

     

    Now you will be able to select corresponding user names based on the selected role. Second you will need to update the selected name to the Assigned To person column. You have to change the Update property of the Assigned To Data Card to following formula:

     

    {
    Claims: "i:0#.f|membership|" & Lower(First(Office365Users.SearchUserV2({searchTerm:AssignedToComboBox.Selected.Result}).value).Mail),
    Department: "",
    DisplayName: AssignedToComboBox.Selected.Result,
    Email: Lower(First(Office365Users.SearchUserV2({searchTerm:AssignedToComboBox.Selected.Result}).value).Mail),
    JobTitle: "",
    Picture: ""
    }

     

    This formula is to search O365 user directory to get the user Email on the selected user name.

     

    Hope this helps.

     

    Best regards,

  • Salesforce Profile Picture
    138 on at

    Hello @v-jefferni,

    Thanks for your response. I tried implementing the above formula it throws an error. Any suggestions are very much appreciated. Thanks in advance.

     

  • v-jefferni Profile Picture
    on at

    Hi @Salesforce ,

     

    Without knowing your formulas, I will not be able to tell the reason. It seems you have referenced to the Combo box itself in its Items property

     

    To be clear, there should be TWO Combo boxes, Items of the first one (AssignedRole) should be like below for users to select the roles:

    ["Approver", "Implementer", "Rejecter"]

     

    Items of the second one (AssignedTo) should be using the first formula in my previous post, Update of the Data Card use the second formula in my previous post.

     

    Best regards,

  • Salesforce Profile Picture
    138 on at

    Hello @v-jefferni,

    Thanks for your guidance.PFA ScreenShot is the formula used on Assigned to Field.

    AssignedTo field is in Submitlist, Implementer field is in the Role Assignment list. These fields are Person fields.

    If we want only the implementer users to appear in the Assigned to field. Can we achieve it using two lists in one form and in a field calling out the other lists? Any help very much appreciated. Thanks in Advance.

     

     

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Salesforce ,

     

    An Edit form will only have one data source and the record it bond to is set in the Item property. Only controls those are within the form could use other data sources. 

     

    As this form is bonding to the Submitlist where includes an AssignedTo person column, there should be a Data Card links to this column in the form. So you need to add a custom Card for this form, place it above the AssignedTo Card , add a Combo box in it then set the Items as below to let users select roles:

    ["Approver", "Implementer", "Rejecter", "Admin"]

     

    Once the role is selected, the AssignedTo Combo box Items:

    Switch(
     AssignedRoleComboBox.Selected.Value,
     "Approver",
     Distinct(
     Rolelist,Approver.DisplayName
     ).Result,
     "Implementer",
     Distinct(
     Rolelist,Implementer.DisplayName
     ).Result,
     "Rejecter",
     Distinct(
     Rolelist,Rejecter.DisplayName
     ).Result,
     "OtherRole",
     Distinct(
     Rolelist,OtherRole.DisplayName
     ).Result
    )

     AssignedRoleComboBox is the Combo box within the custom Card.

     

    At last, you need to change Update of the AssignedTo Data Card to 

    {
    Claims: "i:0#.f|membership|" & Lower(First(Office365Users.SearchUserV2({searchTerm:AssignedToComboBox.Selected.Result}).value).Mail),
    Department: "",
    DisplayName: AssignedToComboBox.Selected.Result,
    Email: Lower(First(Office365Users.SearchUserV2({searchTerm:AssignedToComboBox.Selected.Result}).value).Mail),
    JobTitle: "",
    Picture: ""
    }

     

    Actually, the best approach will be adding an "AssignedRole" Choice column in the SubmitList, so users could select the roles in this list, and you will not need a custom Card to hold those hard-coded roles in the Combo box.

     

    Hope this helps.

     

    Best regards,

  • Salesforce Profile Picture
    138 on at

    Hello @v-jefferni,

    Thanks for your support and guidance. I have implemented the above-mentioned formulae and it worked. Thanks a lot.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard