cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JonnySpitfire
Level: Power Up

Trying to get a Formula to work with a SharePoint List

Howdy, trying to get my PowerApp to filter and allow search on a bunch of SharePoint records...

 

These two lines work independently, i.e. on their own- but I need to combine so that both operate on the List in Question... one allows me to display all records and run a search box to look up an Account. The other forces a filter to just Orange Cases.

 

1. SortByColumns(Filter('MySharePoint List Data', StartsWith(Account, TextSearchBox2.Text)), "Account", If(SortDescending1, Descending, Ascending))

 

2. Filter('MySharePoint List Data', And('Status'="Orange"))

 

Tried a few things but I know someone out there is cleverer than I... How can I put the two together - syntax - so that it pre filters and allows me to search on Account? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Trying to get a Formula to work with a SharePoint List

HI @JonnySpitfire ,

Do you want to combine the two formula that you provided within your app?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Gallery to following:

SortByColumns(
Filter(
'MySharePoint List Data',
StartsWith(Account, TextSearchBox2.Text),
'Status' = "Orange" /* <-- Add this formula */
),
"Account",
If(SortDescending1, Descending, Ascending)
)

Or

SortByColumns(
             Filter(
                     'MySharePoint List Data', 
                      StartsWith(Account, TextSearchBox2.Text) && 'Status' = "Orange"
             ), 
             "Account", 
             If(SortDescending1, Descending, Ascending)
)

More details about Filter function, please check the following article:

Filter function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Super User
Super User

Re: Trying to get a Formula to work with a SharePoint List

Have you tried:

 

SortByColumns(Filter('MySharePoint List Data', StartsWith(Account, TextSearchBox2.Text), 'Status'="Orange"), "Account", If(SortDescending1, Descending, Ascending))
Community Support Team
Community Support Team

Re: Trying to get a Formula to work with a SharePoint List

HI @JonnySpitfire ,

Do you want to combine the two formula that you provided within your app?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Gallery to following:

SortByColumns(
Filter(
'MySharePoint List Data',
StartsWith(Account, TextSearchBox2.Text),
'Status' = "Orange" /* <-- Add this formula */
),
"Account",
If(SortDescending1, Descending, Ascending)
)

Or

SortByColumns(
             Filter(
                     'MySharePoint List Data', 
                      StartsWith(Account, TextSearchBox2.Text) && 'Status' = "Orange"
             ), 
             "Account", 
             If(SortDescending1, Descending, Ascending)
)

More details about Filter function, please check the following article:

Filter function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JonnySpitfire
Level: Power Up

Re: Trying to get a Formula to work with a SharePoint List

Many thanks - sorted...