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 / using 2 sharepoint lis...
Power Apps
Unanswered

using 2 sharepoint lists in a gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello there!

 

I am trying to filter a gallery in a sharepoint based on a value in another sharepoint list but it's giving me the error that's it's not possible to combine these 2 lists. How can I avoid this?


This part is not working;

&& LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd) = "true"


Full code;

If(FilterDropDown.SelectedText.Value = "Geen filter";
SortByColumns(
 Search(
 Filter(
 'D-Nummers-OpleverApp';
 Order = Gallery2_1.Selected.Order && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2)
 );
 TextInput1.Text;
 "Uniek_x0020_nummer"
 );
 "Uniek_x0020_nummer"
 );


 FilterDropDown.SelectedText.Value = "Geopperd";
 Search(
 Filter(
 'D-Nummers-OpleverApp';
 Order = Gallery2_1.Selected.Order && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2) && Verdieping = Dropdown2_1.SelectedText.Result 
 && LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd) = "true"
 );
 TextInput1.Text;
 "Uniek_x0020_nummer"
 )
)

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    With({
     itemsprop:AddColumns(
     'D-Nummers-OpleverApp';"geop";LookUp(
     OpleverApp; Label16.Text = UniekNummer; Geopperd
     )
     )
     };
    
    If(FilterDropDown.SelectedText.Value = "Geen filter";
    SortByColumns(
     Search(
     Filter(
     'D-Nummers-OpleverApp';
     Order = Gallery2_1.Selected.Order && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2)
     );
     TextInput1.Text;
     "Uniek_x0020_nummer"
     );
     "Uniek_x0020_nummer"
     );
    
    
     FilterDropDown.SelectedText.Value = "Geopperd";
     Search(
     Filter(
     itemsprop;
     Order = Gallery2_1.Selected.Order && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2) && Verdieping = Dropdown2_1.SelectedText.Result 
     && geop = "true"
     );
     TextInput1.Text;
     "Uniek_x0020_nummer"
     )
    )

    Please be aware that "SelectedText" has been deprecated and may no longer work in the future.  You will need to use Selected."fieldname"  or Selected.Value or Selected.Result depending on the field and type. 

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey there @Drrickryp 

    Thanks for the help but I get the same error sadly. And it looks like you forgat a ) at the end of the code to close the With operator.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Mind helping me out? I still haven't figured this out

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Please examine closely the offending phase: 

     

     LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd) = "true"

     

    Should true be in double quotes?  What value is represented by Label16.Text and can it be substituted in the equation?  Is UniekNummer a number or an alphanumeric? Could you substitute 

     

     !IsBlank(LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd)) 

     

    for your equation above?  All of this assumes that the rest of your formula works. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello there @Drrickryp 

     

    The formula below works fine, it just aint possible to use 2 sharepoint lists in 1 gallery. So that's why this code isn't working. I can't replace it with the IsBlank code you had, since there will always be a value as text in there (true or false). This is just simple text

     LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd) = "true"


    So we need this code to be transfered with the with statement;

    If(FilterDropDown.SelectedText.Value = "Geen filter";
    SortByColumns(
     Search(
     Filter(
     'D-Nummers-OpleverApp';
     Order = Gallery2_1.Selected.Order && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2)
     );
     TextInput1.Text;
     "Uniek_x0020_nummer"
     );
     "Uniek_x0020_nummer"
     );
    
    
     FilterDropDown.SelectedText.Value = "Geopperd";
     Search(
     Filter(
     'D-Nummers-OpleverApp';
     Order = Gallery2_1.Selected.Order && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2) && Verdieping = Dropdown2_1.SelectedText.Result 
     && LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd) = "true"
     );
     TextInput1.Text;
     "Uniek_x0020_nummer"
     )
    )

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've changed this formula;

     LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd) = "true"


    To:

    ForAll(
     BrowseGallery1.AllItems; 
     If(
     !IsBlank(LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd)); 
     LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd)
     ; "false")
     )


    I get the error that I can't use 2 sharepoints in the same gallery. What can I do to fix? Full code;

    So the lookup can only be "true" or "false" I've tested the formula using a button and that works

    With({
     itemsprop:AddColumns(
     'D-Nummers-OpleverApp';"geop";
     ForAll(
     BrowseGallery1.AllItems; 
     If(
     !IsBlank(LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd)); 
     LookUp(OpleverApp; Label16.Text = UniekNummer; Geopperd)
     ; "false")
     )
     )
     };
    
    If(FilterDropDown.SelectedText.Value = "Geen filter";
    SortByColumns(
     Search(
     Filter(
     'D-Nummers-OpleverApp';
     Order = Gallery2_1.Selected.Order 
     && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2)
     );
     TextInput1.Text;
     "Uniek_x0020_nummer"
     );
     "Uniek_x0020_nummer"
     );
    
    
     FilterDropDown.SelectedText.Value = "Geopperd";
     Search(
     Filter(
     itemsprop;
     Order = Gallery2_1.Selected.Order 
     && Deelorder = Left(Gallery2_1.Selected.Deelordernummer; 2) && Verdieping = Dropdown2_1.SelectedText.Result 
     && geop = "true"
     );
     TextInput1.Text;
     "Uniek_x0020_nummer"
     )
    ))



  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Mind helping me out? @Drrickryp 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Sorry for the delay, real life was interfering.  The only way that I know to use two lists in one gallery is to use table reshaping to add a column to one of the lists by looking up a corresponding value in a second list using a unique value like the ID.  However, AddColumns() is not delegatable in SharePoint and might be limited or inaccurate in large lists.  See if this reference helps you. https://www.powerappsug.com/communities/community-home/digestviewer/viewthread?GroupId=2243&MessageKey=951bb8f7-7729-4c09-bd06-767187a8cdff&CommunityKey=9f5c6fd1-bb0c-4ffa-adab-06d3d72c11da&tab=digestviewer   

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard