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 / CDS Gallery - show res...
Power Apps
Unanswered

CDS Gallery - show results depending on column value

(0) ShareShare
ReportReport
Posted on by 65

Hi,


I am in the process of building my first CDS back end app after using SP Lists for a longggg time, so far so good thankfully.


This app is going to be for fleet management, it's a cds db with a list of fleet cars and whether they are current active/inactive (so the company can look back on previous fleet vehicles and any costs associated with).


I let powerapps generate the app for me and It did a pretty fine job, just got to fine tune it now. On the list gallery it's given me the below code:

 

SortByColumns(Search('Lease Cars', TextSearchBox1.Text,"cr794_emplyee"), "cr794_emplyee", If(SortDescending1, Descending, Ascending))


However I would like to be able to have it only return vehicles that have active column set to yes, is this at all possible? If so my thinking is that I will add a toggle so that you can flip between active/inactive vehicles and then view their records accordingly.


Thanks in advance as always!

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

    Hi @StevenP ,

     

    You can add a filter to the datasource:

    SortByColumns(Search(Filter('Lease Cars',ActiveStatu="Yes"), TextSearchBox1.Text,"cr794_emplyee"), "cr794_emplyee", If(SortDescending1, Descending, Ascending))

    You need to replace "ActiveStatus" with your column name in your data source.

     

    Hope it helps.

     

    Best regards

  • StevenP Profile Picture
    65 on at

    Perfect, thanks ever so much!

  • StevenP Profile Picture
    65 on at

    I've just tried applying this and gotten a weird error, is it possible to filter on a choices column? I setup a 'Status' column with ID cr794_status and gave it two choices, Active/Inactive, I have then updated my gallery to just show the active cars and when I check the logic it comes back that the below is false when I can see the data in the column says active for all vehicles?

     

    Filter('Lease Cars', "cr794_status" = "Active")


    Thanks

  • Community Power Platform Member Profile Picture
    on at

    Hi @StevenP ,

     

    For any choices, you just need to add "Value", then it will work:

    Filter('Lease Cars', "cr794_status".Value = "Active")

     

    Please try the above formula again, and let me know if you need any other help.

     

    Best regards

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard