cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShaneITAutomate
Post Patron
Post Patron

Gallery and If Statments Of Thisitem.Value

Hi,

 

I have a gallery ill call Gallery2 that i use to filter another gallery ill call Gallery1 via a variable.

 

I am however unable to achieve what i want currently.

 

My SharePoint data source has a text column ill call "Pre" that either has "Yes" or is blank.

 

First i use the app.onstart function to collect

 

ClearCollect(
    colChoices,
    {Value: Blank()},
    {Value: "Pending"},
    {Value: "Completed"}
)

 

I use colchoices as the items on Gallery2 and a button with the onsubmit

 

Set(varFilter,ThisItem.Value)

 

I then use the following variable to filter on the items on Gallery 1

 

SortByColumns(
   Filter(
      ColDrillingLog, 
      StartsWith(
         PegID, 
         TextSearchBox1.Text
      ) &&
      (
         IsBlank(varFilter) || 
         Status = varFilter
      )
   ), 
   "Created", 
   If(
      SortDescending1, 
      Ascending,
      Descending
   )
)

 

 I want the variable to display

 

Yes or Blank() as "All"
Blank as "Pending" and
Yes as "Completed"

 

All my combination are failing me..

1 REPLY 1
ShaneITAutomate
Post Patron
Post Patron

I should say i can get it too work with the following however it doesnt display the blanks as pending..

 

If(
IsBlank(ThisItem.Value), "All",
ThisItem.Value = "Yes", "Completed"
)

 

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,143)