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 / Gallery Search using f...
Power Apps
Answered

Gallery Search using field text

(0) ShareShare
ReportReport
Posted on by 32

Greetings!!

 

Please, I need a help.

 

I created an app and I want to filter gallery content by using a search field:

llange_0-1697511611803.png

 

With this formula I got no error, and I can only filter values by toogle position:

llange_1-1697511725684.png

 

SortByColumns(
Filter(Ceov_Sistema_Entrevistas;Finalizada=Toggle1.Value);
"cre47_id_pessoa";
If(SortDescending1; SortOrder.Descending; SortOrder.Ascending)
)

 

I tried above formula and got no error or warning, but it does not work (no filter) and throw errors on another part (when selecting an record on the gallery I am redirected to a edit form), complaining "expecting datasource compatible value"

 

//SortByColumns(
// Search(
// Filter(
// AddColumns(Ceov_Sistema_Entrevistas;"id_assistido";Text("cre47_id_pessoa"));
// Finalizada=Toggle1.Value);
// Campo_Busca_Entrevista.Text;
// "id_assistido");
// "id_assistido";
// If(SortDescending1; SortOrder.Descending; SortOrder.Ascending))

 

I had to use Addcolumns because cre47_id_pessoa is a number field.

 

I'm using a dataverse table to store my data.

 

Thank you in advance!!

Categories:
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @llange ,

     

    Can you tell me the type of Finalizada column, if it is a text column and stored is true/false, please try this:

    SortByColumns(
    Filter(Ceov_Sistema_Entrevistas;Finalizada=Text(Toggle1.Value));
    "cre47_id_pessoa";
    If(SortDescending1; SortOrder.Descending; SortOrder.Ascending)
    )

     

    Best regards,

    Rimmon Li

  • llange Profile Picture
    32 on at

    Hello @v-mengmli-msft . Thank you for your message.

    Let me explain better. I started this topic late at night, so I apologize for any confusion.

     

    I have a table called Ceov_Sistema_Entrevistas that represents an interview event. Each interview row has an ID field with auto increment and a "Finalizada" (completed) field, which is a yes/no field. This field is filtered correctly with the first code, and the toggle gallery follows the filter.

     

    When you conduct an interview, you interview a person, and this person belongs to another table with personal information. I copy the person's ID (an integer field with auto increment) to the interview table. This is like a foreign key, but I don't want to create table relationships, so I just paste the ID as a number in the column.

    It is this person ID that I want to filter, but I can't figure out why my formula is not working. First, it complains that a text value is expected for the filter, so I added an AddColumn function to convert the integer to text, but that didn't work either.

     

    The gallery title is what I'm looking to filter inside the text field.

    llange_0-1697543819901.png

     

    Hope this new explanation can helps.

  • Verified answer
    llange Profile Picture
    32 on at

    I could solve the problem. I inverted Search and Filter and worked!!

    Final code:

    SortByColumns(
    Filter(
    Search(
    AddColumns(Ceov_Sistema_Entrevistas;"id_pessoa";Text(cre47_id_pessoa));
    Campo_Busca_Entrevista.Text;
    "id_pessoa");
    Finalizada=Toggle1.Value
    );
    "cre47_id_pessoa";
    If(SortDescending1; SortOrder.Descending; SortOrder.Ascending)
    )

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard