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 multiple values fr...
Power Apps
Answered

Get multiple values from different column using LookUp

(0) ShareShare
ReportReport
Posted on by 443

Hi all,

I'm having a little problem getting a collection set up.  I have a sharepoint list that has a few departments and they each have a unique ID.   There is also a manager for each department, and a manager may have more than one department assigned to them.  I'm trying to grab all records with the manager's email, trying extract the department ID for each record, and put it into a collection.  This is what I have so far...

 

Set(var_CurrentUserEmail, Office365Users.MyProfileV2().mail);
ClearCollect(col_CurrentUserDeptIDs, LookUp(Departments, var_CurrentUserEmail in Managers.email, ID));

 

I know I'm missing something.  Please help!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    I think you can't use LookUp in your case because that's only going to bring one record.

     

    I would use a combination of Filter to select the items you want to select and then add a 'ShowColumns" to bring only the columns you need so your collection doesn't look so messy.

     

    It would be something like this:

     

    ClearCollect(col_CurrentuserDeptIDs,ShowColumns(Filter(Departments,ManagerEmail=var_CurrentUserEmail),"ColumnName1","ColumnName2","ColumnName3"))

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

    Hi @lumberjacklurch,

    Could you please share a bit more about the Managers column in your SP list?

    I suppose that the Managers column that you mentioned is a Person type column in your SP list, is it true?

    Based on the formula that you provided, I think there is something wrong with it. The LookUp function could only be used to find the first record in a table that satisfies a formula.

    If you want to retrieve the department ID for each one of the extracted records, please take a try with the following workaround:7.JPG

    Set the OnSelect property of the "Collect"  button control to following:

    Set(var_CurrentUserEmail,User().Email);
    ClearCollect(
    col_CurrentUserDeptIDs,
    Filter('20181119_case13',Manager.Email = var_CurrentUserEmail).ID
    )

    On your side, you should type following:

    Set(var_CurrentUserEmail, Office365Users.MyProfileV2().mail);
    ClearCollect(
    col_CurrentUserDeptIDs,
    Filter('YourSPList',Managers.Email = var_CurrentUserEmail).ID
    )

    The col_CurrentUserDeptIDs collection as below:
    8.JPG

    Above formula may cause a Delegation issue, in order to get rid of this issue, please take a try with the following workaround:

    Set the OnVisible property of the first screen of your app to following:

    ClearCollect(RecordsCollection, 'YourSPlist')

    Set the OnSelect property of the "Collect" button to following:

    Set(var_CurrentUserEmail, Office365Users.MyProfileV2().mail);
    ClearCollect(
    col_CurrentUserDeptIDs,
    Filter(RecordsCollection, Managers.Email=var_CurrentUserEmail).ID
    )

    Best regards,

    Kris

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