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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,179)