Canvas App:

A canvas app is a type of app in Microsoft Power Apps that allows users to design and build custom business apps without writing code

In this Blog we will see How to Filter “My Records” and “All Records” On Grid Based on Button’s Click in Canvas App.

I have a Records in my canvas app i want filter the records based on “My Records” and “All Records” Buttons On Grid Based on Button’s Click.

And also one more requirement is when we click on “My Records” Button the “All Records” we will display like a disable type(color will display like a disabled) same for “All records” button also when we click on “All records” Button the “My Records” button we will display like a disable type(color will display like a disabled). like the below screenshot.

Canvas App

First we add on container and change the width of the container “parent. Width” and Height:38 you will change the properties of that container based on your requirement. and insert two buttons in to the container.

Next change the Properties of Buttons for to change the colors like to show “Active”- “Disabled”.

My Records:

BorderColor: RGBA(0, 0, 0, 0)

BorderStyle:BorderStyle.None

DisabledBorderColor:RGBA(161, 159, 157, 1)

DisabledColor: RGBA(0, 0, 0, 0)

DisabledFill:RGBA(242, 242, 241, 0)

Fill:If(Button4Clicked, RGBA(240, 190, 185, 1), RGBA(56, 96, 178, 1))

Height:30

HoverBorderColor: RGBA(0, 0, 0, 0)

HoverFill: RGBA(235, 23, 0, 1)

Onselect:Set(View, “My”);

Set(Button1Clicked, true);

Set(Button4Clicked, false)
 
PressedBorderColor:RGBA(235, 23, 0, 1)
PressedColor:RGBA(255, 255, 255, 1)
PressedFill:RGBA(235, 23, 0, 1)
RadiusBottomLeft:4
RadiusBottomRight:4
RadiusTopLeft:4
RadiusTopRight:4
Text: “My Records”
X:45
 
All Records:
Use Same properties But change 

Onselect:

Set(View, “All”);
Set(Button4Clicked, true);
Set(Button1Clicked, false)
Text: “All Records”
 
 

Next Change the Gallery properties for to filter based on buttons select.

Default:{}

items:

If(
    View = “My”,
Filter(
        ‘Student Registration’,
        ‘Created By’.Email = User().Email
    ),
View = “All”,
    Filter(
        ‘Student Registration’,
        true
    )
)

Next paste the below code on Screen Onvisible

ClearCollect(MyRecords, Filter(‘Student Registration’,’Created By’.Email = User().Email));
ClearCollect(AllRecords, ‘Student Registration’);
Set(View, “My”);
 

Now Save and test your App it is working as expected.

 

For any Help or Queries Contact us on info@crmonce.com or +91 8096556344

https://www.crmonce.com/how-to-show-pop-up-text-when-we-click-on-info-symbol-in-canvas-app/