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 / Fetching the correspon...
Power Apps
Answered

Fetching the corresponding values from another list

(0) ShareShare
ReportReport
Posted on by 274

Hi PowerApps users,

Please help me with the below scenario-

I have a Master list with a Muti selectable Choice field called Departments. There is another list- Child list with the same value of departments stored as text field and a corresponding Head of Department (HOD)- Persons field (multi valued).

Master List-

Departments [Mutiselectable Choice fields]

Child List-

Departments [Single line text fields]

HOD [Muti valued Person field]

When a department (s) is selected, the user should be displayed with the display names of the HODs to whom the mail will be triggered.

Can anyone direct me on how i can fetch the corresponding HOD details from the Child list.

Any help appreciated.

Thanks,

Kevin

Categories:
  • kevingeorget Profile Picture
    274 on at

    Just an update,

    if the choice field in the Master list is not multichoice (single valued), then this would work-

    LookUp('ChildList',Title=DataCardValue2_Departments.Selected.Value,HOD.Email)

    How can i get this working for a multichoice field. I tried using ForAll, not able to get the correct expression to use.

    Regards,

    Kevin

  • panand99 Profile Picture
    641 on at

    @kevingeorget 

     

    on the multiple selection combo box OnChange event you need to create a collection and then iterate this collection to some other collection. below is the formula you can use:- 

     

     

    Clear(Collection1);
    Clear(EmailCollection);
    ForAll(cb_SubTeams.SelectedItems,Collect(Collection1,Result));
    ForAll(Collection1,Collect(EmailCollection,Filter(AllTeamMembers,TeamName.Value=Value).MemberEmail))

     

    You can use Filter or lookup based on your need.

    This formula is working at my end, please change the values accordingly.

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @kevingeorget,

    Instead of using '=' is it not possible in this situation to use 'exactin'? Then it checks if the value is in one of the values of the multichoice.
    LookUp('ChildList',Title exactin DataCardValue2_Departments.Selected.Value,HOD.Email)

    Hope this helps!

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @kevingeorget ,

    I have made a test on my side, please consider take a try with the following workaround:5.JPG

     

    6.JPG

    Set the Items proeprty of the Dropdown box to following:

     

    Distinct(
     Filter(
     Split(
     Concat(
     ForAll(
     ForAll(Filter('20190108_School', School in ComboBox1.SelectedItems.Value).Executor, Executor.Email),
     Concat(Value, Email & ";")
     ),
     Value
     ),
     ";"
     ),
     !IsBlank(Result)
     ),
     Result
    )

    Note: The Executor is a Person type column in my School List, which has enabled "Allow Multiple Selections" option.

     

    On your side, if you want to get the corresponding HOD email table based on the selected departments value, please take a try with the following formula:

     

     

    Distinct(
     Filter(
     Split(
     Concat(
     ForAll(
     ForAll(Filter('ChildList', Title in DataCardValue2_Departments.SelectedItems.Value).HOD, HOD.Email),
     Concat(Value, Email & ";")
     ),
     Value
     ),
     ";"
     ),
     !IsBlank(Result)
     ),
     Result
    )

    Please consider take a try with above solution, then check if the issue is solved.

     

    More details about ForAll function, Concat function and Split function, please check the following article:

    ForAll function, Concat function and Split function

     

    Best regards,

     

  • Verified answer
    kevingeorget Profile Picture
    274 on at

    Hi @panand99 ,

    Apologies, I'm just a beginner.
    I almost got the result. But the EmailCollection has the Person field as a whole. How do i get the Email property only from it.

    Clear(Collection1);Clear(EmailCollection);ForAll(DataCardValue2_Departments.SelectedItems,Collect(Collection1,Value));ForAll(Collection1,Collect(EmailCollection,Filter(ChildList,Title=Value).HOD));


    I tried adding another collection to filter out only the email, but that doesnt work.
    ForAll(EmailCollection,Collect(EmailCol,HOD.Email))



    Hi @Anonymous ,

    Your suggestion was the simplest of all and it kind of works although with the delegation warning. Need to see how i can fix the delegation warning.

     

     

    Hi @v-xida-msft ,

    It took me sometime to figure out the solution you provided. It works, but with the delegation warning. I don't want to entirely use this solution as i found a simpler way.

    Any suggestion on how i can fix the delegation warning?

     

    Appreciate the help guys.

    This is the solution i could come up with the suggestions you guys provided.

    On the OnChange property of the Master list Department field-

     

    Clear(Collection1);Clear(EmailCollection);

    ForAll(DataCardValue_DeptChoice.SelectedItems,Collect(Collection1,Value));ForAll(Collection1,Collect(EmailCollection, LookUp(Childlist,Department_Lookup exactin Value,HOD.Email)))

    Now i assigned the EmailCollection to the Items property of my Dropdown.

     

    Regards,

    Kevin

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard