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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default Value on DropD...
Power Apps
Answered

Default Value on DropDown based on Selected Value on First Dropdown

(0) ShareShare
ReportReport
Posted on by 41

Hi again everyone! 

 

So I have 3 person fields in my sharepoint list (list_MentorshipSession)

Mentee_FullName

Mentor_A

Mentor_B

 

Then I also have 3 person fields in my sharepoint list (lsit_MentorshipDetails)

Mentee_FullName

Mentor_A

Mentor_B

 

My PowerApps Create Record form is linked primarily to the first sharepoint list, list_MentorshipSession

I want users to just select the Mentee's Fullname and it would automatically populate/capture the Mentors using the list_MentorshipDetails (datasource) and that the selection/dropdown on the create record will not be editable 

 

Formname of the Edit/Create Form = EditForm1

Combo box name of the Mentee Fullname = DataCardValue10

 

I tried a couple of codes based on some search results in this community but I can't seem to make them work 

ex. LookUp(list_MentorshipDetails, Mentee_FullName = DataCardValue10.Selected.DisplayName).Mentor_A

 

mangchaaBI_0-1661154468828.png

 

Thanks in advance! 

Categories:
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @mangchaaBI I don't fully understand what you are trying to achieve. 

     

    Mentee_FullName

    Mentor_A

    Mentor_B

     

    are ALL person fields in SharePoint in both lists? Right?

     

    On your screenshot I see the fields "Mentees Fullname", "Mentors Fullname" and "co-Mentors Fullname". Are they related to fields mentioned above? 

     

    My assumption: If somebody selects a person in "Mentees Fullname" DropDown on the form you want to check the Details list to get the Values from Mentor_A and Mentor_B and populate those values in your form in "Mentors Fullname" and "co-Mentors Fullname". Is that correct?

  • mangchaaBI Profile Picture
    41 on at

    Hi @PowerRanger appreciate your response and apologies if you got confused with my needs 

     

    are ALL person fields in SharePoint in both lists? Right? 

    - Yes they are all person fields 

     

    On your screenshot I see the fields "Mentees Fullname", "Mentors Fullname" and "co-Mentors Fullname". Are they related to fields mentioned above? 

    - the screenshot above is my create new session form, where data input here are sent to the list_MentorshipSession (sharepoint list) in which the Mentee Fullname = Mentee_Fullname, Mentor's Fullname = Mentor_A, and co-Mentor = Mentor_B

    Now I also have another sharepoint list called, list_MentorshipDetails where a repository of all Mentor to Mentor list is pre-filled by Admin.. so as whenever I select a Mentee_Fullname in the drop down, it will lookup the value of the Mentor and Co-Mentor in the list_MentorshipDetails instead of them manually filling up those 2 fields

     

    My assumption: If somebody selects a person in "Mentees Fullname" DropDown on the form you want to check the Details list to get the Values from Mentor_A and Mentor_B and populate those values in your form in "Mentors Fullname" and "co-Mentors Fullname". Is that correct?

    - This is correct, just that I want to populate them using the list I have in the other datasource (list_MentorshipDetails) 

     

    Thanks

  • mangchaaBI Profile Picture
    41 on at

    To give a visual view.. 

     

    So on the example below, if Alvin was selected as the Mentee, then Reynald and Ryan will be placed as the Mentor (Mentor_A)/co-Mentor (Mentor_B) respectively based on the list_MentorshipDetails where Alvin's Mentors are Reynald (Mentor_A) and Ryan (Mentor_B)

     

    mangchaaBI_0-1661159291289.png

     

  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @mangchaaBI On your form add this formular to you "Mentors Fullname" DataCard DefaultSelectedItems property:

     

    With(
     LookUp(
     list_MentorshipDetails,
     Mentee_FullName.Email = DataCardValue10.Selected.Email
     ),
     {
     Claims: "i:0#.f|membership|" & Lower(ThisRecord.Mentor_A.Email),
     Department: "",
     DisplayName: ThisRecord.Mentor_A.Email,
     Email: ThisRecord.Mentor_A.Email,
     JobTitle: ".",
     Picture: "."
     }
    )

     

    What this Formular does: 

    1. It LookUps the record in the Details list based on the value you have entered in DataCardValue10

    2. It creates a record with the properties which are required for the SharePoint people picker

     

    For Co-Mentor use the same formular but change ThisRecord.Mentor_A with ThisRecord.Mentor_B

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • mangchaaBI Profile Picture
    41 on at

    Hi @PowerRanger 

     

    Just added it and thought it would run fine as it started loading, but eventually triggered a red line error below

     

    mangchaaBI_0-1661162452855.png

     

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @mangchaaBI could you verify (provide a screenshot) that the column Mentor_A on your details list is a single select PeoplePicker field?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • mangchaaBI Profile Picture
    41 on at

    Hi @PowerRanger 

     

    That's perfect! it was a Multi Selection Person, removed the option to multi select and viola! 🙂 

     

    Now if I want to show the DisplayName, instead of the email.. should I just replace the .Email to .Displayname? instead? (and do you have a trick so it would just grab the full name instead of the Displayname?)

     

    Thanks a lot! 

     

    mangchaaBI_0-1661163780069.png

     

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @mangchaaBI You are right, my fault. Ofcourse it should be .DisplayName for the DisplayName property.

     

    With(
     LookUp(
     list_MentorshipDetails,
     Mentee_FullName.Email = DataCardValue10.Selected.Email
     ),
     {
     Claims: "i:0#.f|membership|" & Lower(ThisRecord.Mentor_A.Email),
     Department: "",
     DisplayName: ThisRecord.Mentor_A.DisplayName,
     Email: ThisRecord.Mentor_A.Email,
     JobTitle: ".",
     Picture: "."
     }
    )

     

    These are the only values you could display (or at least I am aware of) :

    PowerRanger_0-1661164731131.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • mangchaaBI Profile Picture
    41 on at

    All good thanks again, I can live with the DisplayName showing up in there instead of just the FullName

     

    Thanks again! Happy guy here 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard