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 / Filtering SharePoint d...
Power Apps
Answered

Filtering SharePoint document library by two parameters

(0) ShareShare
ReportReport
Posted on by 8

Hi - as above I am filtering a SharePoint document library and I am experiencing some variable outcomes when I toggle between using ALT in my Editing session and previewing the app (F5). Essentially I am changing some filtering code to include an extra parameter and it works fine to execute what I need in the edit session, but doesn't filter when previewing the app (F5). Here is the original code with one filter parameter (which works fine in edit and preview) :

<tr>" & "
 <td colspan=""7"" class=""content"">" & "Supporting information:" & "
 <ul>
 " & Concat(
 Filter(
 'KPI attachments',
 KPI_ID = 'Select a KPI'
 ),
 "
 <li><a target=""_blank"" href=""" & 'Link to item' & """>" & Description & "</a></li>" & Image & "
 "
 ) & "
 </ul>
 " & "</td>
 " & "</tr>

 

And here is my code with the extra filter parameter (only works in the ALT-edit session):-

<tr>" & "
 <td colspan=""7"" class=""content"">" & "Supporting information:" & "
 <ul>
 " & Concat(
 Filter(
 'KPI attachments',
 KPI_ID = 'Select a KPI',
 Text(
 Date,
 "yyyy"
 ) = Text(ddDateList.Selected.Value)
 ),
 "
 <li><a target=""_blank"" href=""" & 'Link to item' & """>" & Description & "</a></li>" & Image & "
 "
 ) & "
 </ul>
 " & "</td>
 " & "</tr>

 

 I assume I need to tidy up the code, any suggestions are welcome. Cheers, Thom

Categories:
I have the same question (0)
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Not sure exactly why it only works using ALT-hold, but, I do have a few suggestions:

     

    Don't name your data columns with a name that conflicts with an existing Power Apps function - in this case, 'Date' as it will confuse the Editor when you try to filter by something that is the name of a function

     

    I would also advise not running a conversion function against the datasource as that then requires calculations at the datasource end which will likely not be delegated and cause delegation issues - if at all possible, when you write data to the source, assuming its from this same app, write a column for each item called 'DateYearValue' that contains the output of that conversion function ie "2024" - that way you can filter in your gallery later by a single line text column or a number (depending on how you choose to store it) like this:

    Filter(
     'KPI attachments',
     KPI_ID = 'Select a KPI',
     DateYearValue = ddDateList.Selected.Value
    )

     

    Lastly, don't use just the control name when referring to a control 'Select a KPI', be explicit and list the specific property you are looking for as sometimes it will try and be smart and match a different property

    Filter(
     'KPI attachments',
     KPI_ID = 'Select a KPI'.Selected.Value,
     DateYearValue = ddDateList.Selected.Value
    )

     

    Hope this helps a bit!

    Cheers,

    Sancho

  • Thommy Profile Picture
    8 on at

    Thanks for your suggestions. I was able to incorporate a single line of text column to achieve the filtering. Cheers

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard