cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jotapece
Level: Powered On

Gallery TemplateFill & Dropdown & Checkbox

Hello.

 

I have a Gallery with Checkbox called "chkPagar".

I want to change the fill color of item a gallery when I check this checkbox, so in the gallery templatefill put this code:

If( chkPagar.Value ; RGBA(206; 255; 157; 1) ; RGBA(0; 0; 0; 0))

Everything works fine. I click the checkbox and fill and unfill correctly.

I also have a dropdown which changes the gallery items.

When I change the value of the dropdown I get all my gallery fill in green.

It's only happend when I actually check the box and change the dropdown.

 

Attach is a gif with the situation.

 

Any Ideas?

 

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jotapece
Level: Powered On

Re: Gallery TemplateFill & Dropdown & Checkbox

Hi. The problem solved "itself".

When I implement the code to Patch() the tblPagosProvedores the TemplateFill worked propertly.

Another life's mistery unsolved.

Thank you.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Gallery TemplateFill & Dropdown & Checkbox

Hi @jotapece 

 

Could you please share more details of your Gallery and DropDown control, what are their formula expression?

And how do you mean the dropdown can change the gallery items?

 

Best Regards.

Yumia

 

 

jotapece
Level: Powered On

Re: Gallery TemplateFill & Dropdown & Checkbox

Hello @v-yuxima-msft . Thank you for your response.

 

I have connected three .xlsx:

 

  1. tblPagosProveedores: The fact table. Has ID=CentroCosto field.
  2. tblCentrosCostos: This has many fields. The important one ID=CentroCosto. This table is the dimesión for all IDs.
  3. tblUsuarios: This table has 2 fields:
    1. CentroCosto: ID
    2. Correo: User's email to validate with User() function.

The dropdown code:

Items=If(
    First(
        Filter(
            tblUsuarios;
            Correo in User().Email
        ).CentroCosto
    ).CentroCosto in 0;
    tblCentrosCostos.CentroCosto;
    Filter(
        tblCentrosCostos;
        CentroCosto in Filter(
            tblUsuarios;
            Correo = User().Email
        ).CentroCosto
    ).CentroCosto
)

The gallery code:

Items=Filter(tblPagosProveedores; CentroCosto = Text(dropCentrosCosto.Selected.CentroCosto))

The dropdown code filters the tblCentrosCostos validating with User().Email. Only populatec a few ID=CentroCosto for each user.

The gallery code filter the tblPagosProveedores by ID=CentroCostos set in the dropdown.

 

In the gallery I have this code too:

TemplateFill = If( chkPagar.Value ; RGBA(206; 255; 157; 1) ; RGBA(0; 0; 0; 0))

And in the checkbox I put this code:

Default = If(Prioridad = "1" ; true ; false )

"Prioridad" is a field in tblPagosProveedores.

 

The gallery load tblPagosProveedores filter by ID=CentroCosto set in the dropdown. When the data is load in the gallery the chekbox.Default property is set to true (in some cases) and the TemplateFill fill in green the item in the gallery. 

 

Did you see the .gif attached in my previous post?

 

The problem:

 

  1. If ONLY change my dropdown value everything works.
  2. If I checkbox = true something and then change the dropdown every item in the gallery fill in green ( RGBA=206; 255; 157; 1 ).

I hope have property explained myself.

 

Regards.

jotapece
Level: Powered On

Re: Gallery TemplateFill & Dropdown & Checkbox

Hi. The problem solved "itself".

When I implement the code to Patch() the tblPagosProvedores the TemplateFill worked propertly.

Another life's mistery unsolved.

Thank you.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,121)