cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Michall33
Regular Visitor

How to create unique search logic

Hello,

 

I am trying to link a Gallery, Search Text Box, and a Sort Icon, but I can get nothing to work together.  I have tried different combinations of logic and searched various sites but have not been able to get anything to work correctly.  

 

Here is my current status:

Sort Icon

OnSelect Formula = SortByColumns(Search('Project List',SearchEmployee.Text,"TeamMember","ProjectStatus","Projects","Title"),"TeamMember",If(SortDescending1,Descending,Ascending))

AccessibleLabel Formula = Self.Tooltip

 

SearchEmployee Text Box

OnChange = false

OnSelect = SortByColumns(Search('Project List',SearchEmployee.Text,"TeamMember","ProjectStatus","Projects","Title"),"TeamMember",If(SortDescending1,Descending,Ascending))

 

Project Gallery

OnSelect formula = Navigate(Project_Details,ScreenTransition.None)

Items formula = SortByColumns(Search('Project List',SearchEmployee.Text,"TeamMember","ProjectStatus","Projects","Title"),"TeamMember",If(SortDescending1,Descending,Ascending))

 

In the Project Gallery, once I overrode the SharePoint List name with the equation, all the lines of data disappeared.  I basically see the below which shows a warning for all three of the elements I am trying to link up.

 

Michall33_0-1601473190776.png

 

THanks!

 

13 REPLIES 13

Hi @RandyHayes ,

 

Your recommendation did solve the issue of the displaying the fields. However I could not use "TeamMember" within the equation otherwise the gallery items would still not show.  I had to use the below equation instead within Items field in the Gallery:

 

SortByColumns(Search('Project List',SearchEmployee.Text,"Title"),"Title",If(SortOrder,Descending,Ascending))

 

I would like to expand the search options beyond title since multiple people and topics will be searched, but every time I try to add additional fields to search I get the error popping up again.  Is there any way to fix this?

 

Thanks!

@Michall33 

Tell me about these columns  "TeamMember",  "ProjectStatus", "Projects", and "Title"

Are they ALL text columns or are they different?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes ,

 

All the columns are different actually.  Only Title is Text.

 

TeamMember = is a choice field from my organizations population

Project Status = choice field

KPI = choice field

 

Thanks!

@Michall33 

Yep...that will make a huge difference!!

 

Try this then:

DropColumns(
    SortByColumns(
        Search(
            AddColumns('Project List',
                "txtTeamMember", TeamMember.Value,
                "txtProjectStatus", ProjectStatus.Value,
                "txtKPI", KPI.Value
            ),
           SearchEmployee.Text,
           "txtTeamMember",
           "txtProjectStatus",
           "txtKPI",
           "Title"
        ),
        "txtTeamMember",
        If(SortOrder,Descending,Ascending)
    ),
    "txtTeamMember",
    "txtProjectStatus",
    "txtKPI"
)

 

You now mention KPI - before we had Projects...is that KPI?  Is that something that needs to be in the formula?  Not sure where that went from your response.

 

Anyway, the above converts the values of the choice columns into text columns (via add columns) and then searches on the text columns.  Finally, it drops the columns as to avoid any conflicts with other areas in your app.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,280)