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 / Multiple Formulas in a...
Power Apps
Unanswered

Multiple Formulas in a Gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All, 

 

Quite new to powerapps, but built quite a handy app so far but I'm looking to run two formulas in a Gallery in the Items selection, and don't know how to mold the two together.

 

I have this which makes sure the gallery only shows items raised by that user, and sorts it by newest case:

 

SortByColumns(

    Filter(VBMLForm,'Created By'.Email = User().Email

    )

    ,"ID"

    ,Descending

)

 

And then I have this which is the formula for my buttons which filter the gallery based on approval status,

 

If(

   IsBlank(vFilter),

   VBMLForm,

   Filter(

      VBMLForm,

      'Task Status'.Value=vFilter

   )

  

)

 

However given my only recent introduction into Coding I'm not sure on how I go about forging these together, they work perfectly on their own, but I don't know how to merge them into one. Any help would be appreciated 🙂 

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    You should just be able to change the Filter statement

      Filter(VBMLForm,'Created By'.Email = User().Email) And 'Task Status'.Value=vFilter

    And leave the reset of the statement the way you have it

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Okay thank you so this works:

     

    SortByColumns(
    Filter(VBMLForm,'Created By'.Email = User().Email And 'Task Status'.Value=vFilter
    )
    ,"ID"
    ,Descending
    )

     

    However, when no options are selected or the all cases button is pressed, it isn't applying the default view ( Blank ) where it shows me all open cases.

    My button for "All Cases" has the following formula 

     

    UpdateContext({vFilter:Blank()}),

     

    There is then a button for pending, approved, and rejected, and those three work as expected, any ideas? 

     

    Thanks again

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I think the issue is the Filter on the User email - is that right?

    If so, you will need to wrap the whole thing in an If statement. Instead of the All Cases button changing the vFilter, assign it a different Boolean variable. Then check that first in your If statement and if All Cases is true, just do the SortBy Columns. Or if you still want to filter out the pending, approved, etc. just drop the User Filter and leave the rest

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard