cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Margaryta
Helper I
Helper I

Wrong data is shown in a gallery

Sometimes wrong data is displayed in a gallery. However, the data becomes correct after refreshing the page.

 

Example: a user filtered gallery by a dropdown.
Screenshot 1 - after filtering (wrong data - the dates and item names are messed up)

Screenshot 2 - after refreshing the page and filtering once again (correct data).


The source is an Azure SQL server database.

 

It also happens with my other apps from time to time. Is it some sort of a cache issue? Does anyone know a way to solve it?

18 REPLIES 18
WarrenBelz
Super User
Super User

Hi @Margaryta ,

What are the Items of the Gallery?

Hi @WarrenBelz ,

Here's what I have in Items:

If(And(IsBlank(Dropdown3_3),Not(IsBlank(Dropdown3_4))), Filter('[dbo].[inventory_allocation]', employee_code=Dropdown3_4.Selected.employee_code), If(And(Not(IsBlank(Dropdown3_3)),IsBlank(Dropdown3_4)), Filter('[dbo].[inventory_allocation]',inventory_code=Dropdown3_3.Selected.inventory_code), Filter('[dbo].[inventory_allocation]',inventory_code=Dropdown3_3.Selected.inventory_code && employee_code=Dropdown3_4.Selected.employee_code)))

It can be filtered by employee_code, inventory_code, or by both.

@Margaryta ,

Try this

With(
   {
      wInvent:Dropdown3_3.Selected.inventory_code,
      wEmploy:Dropdown3_4.Selected.employee_code
   },
   Filter(
      '[dbo].[inventory_allocation]', 
      (
         IsBlank(wInvent) || inventory_code=wInvent
      ) &&
      (   
         IsBlank(wEmploy) || employee_code=wEmploy
      )
   )
)  

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz thank you for looking into this. However, this formula doesn't work, whether way I filter the gallery, it remains empty.

Hi @Margaryta ,

The formula is the correct syntax and allows for either blank dropdowns or filters by values in them. Try this instead

With(
   {
      wInvent:Dropdown3_3.Selected.inventory_code,
      wEmploy:Dropdown3_4.Selected.employee_code
   },
   Filter(
      '[dbo].[inventory_allocation]', 
      (
         Len(wInvent)=0 || inventory_code=wInvent
      ) &&
      (   
         Len(wEmploy)=0 || employee_code=wEmploy
      )
   )
)  

Did you test this with something in the drop-downs?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WarrenBelz 

Yes, I've tested both of your variants choosing values in the dropdowns, and the gallery remains empty.

Also, I've changed this part

      (
         Len(wInvent)=0 || inventory_code=wInvent
      ) &&
      (   
         Len(wEmploy)=0 || employee_code=wEmploy
      )

into this

(
IsBlank(wInvent) || inventory_code=wInvent
) &&
(
IsBlank(wEmploy) || employee_code=wEmploy
)

 cause there was an error because wInvent and wEmploy are numbers, not text. It didn't help anyway.

Hi @Margaryta ,

Let's get down to some basic debugging - if you do this

Filter(
   '[dbo].[inventory_allocation]', 
   inventory_code=Dropdown3_3.Selected.inventory_code
)

and select something and then this

Filter(
   '[dbo].[inventory_allocation]', 
   employee_code=Dropdown3_4.Selected.employee_code
)  

and do the same, do you get results from either / both?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @WarrenBelz 

Yes, both formulas work as expected - the first one allows to filter by inventory_code and the second one - by employee_code.

@Margaryta ,

What type of fields are employee_code and inventory_code in your data source?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,042)