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 / Pull data from Sharepo...
Power Apps
Answered

Pull data from Sharepoint List LookUp column with multiple value

(0) ShareShare
ReportReport
Posted on by 29

As in the topic, I need to retrieve data from a lookup sharepoint list column that can have from zero to three selected values.

I want to create a collection from this data so that I can then create a gallery based on it.

 

SharepointList:

NameSurnameSubstitute
Name1Surname1 
Name2Surname2Surname3
Name3Surname3 
Name4Surname4Surname1, Surname3

 

Lookup column is relative to the same Sharepoint List.

 

For now I could not even filter my sharepoint list to show recods with choosed substitute, but I was able to pull out all values from Substitute column into gallery (per record)

 

What I want to achieve:

Distinct collection of Substitute column - [Surname1, Surname3]

Filtered list of people who choosed their substitute.

Categories:
I have the same question (0)
  • NPPlatform Profile Picture
    606 Moderator on at

    Hi @BacKan , you can create a distinct collection of the Substitute column with the following formula:

     

    ClearCollect(
    SubstituteDistinct,
    Distinct(
    Filter(
    ShowColumns(
    Ungroup(
    SharePointListName,
    "Substitute"
    ),
    "Value"
    ),
    Value <> Blank()
    ),
    Value
    )
    )

    You can create a list of all people with a substitute with the following formula:

    Filter(
    Ungroup(
    SharePointListName,
    "Substitute"
    ),
    Value in SubstituteDistinct
    )


    Edit: if your end goal is only to see which people have chosen a substitute you can do this with one formula:

     

    Distinct(
    Filter(
    Ungroup(
    SharePointListName,
    "Substitute"
    ),
    "Value",
    Value <> Blank()
    ),
    Surname
    )
  • BacKan Profile Picture
    29 on at

    Nothing from this works in my app. Everything returns empty list.

     

    It may be important - my source list has a lot of records, about 2k.

  • Verified answer
    BacKan Profile Picture
    29 on at

    I found the solution. I used ForAll function to append my values to the collection.

     

    With code below I was able to create the list of people who choosed their substitute.

     

     

    ClearCollect(varSubstitute;Blank());;
    ForAll(
     Filter('SHAREPOINT_LIST_NAME';YOUR_FILTERS);
     If(CountRows(substitute #column name here) > 0;Collect(varSubstitute;{NAME:ThisRecord.first_name;SURNAME:ThisRecord.surname;ID:Index(substitute;1).Id}));;
     If(CountRows(substitute) > 1;Collect(varSuccessors;{NAME:ThisRecord.first_name;SURNAME:ThisRecord.surname;ID:Index(substitute;2).Id}));;
     If(CountRows(substitute) > 2;Collect(varSuccessors;{NAME:ThisRecord.first_name;SURNAME:ThisRecord.surname;ID:Index(substitute;3).Id}));;
    )

     


    To achieve my second goal I could easily collect ID only and then create another collection with distinct values, but this solution gives me more flexibility.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#2
Haque Profile Picture

Haque 69

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard