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?
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.
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.
What type of fields are employee_code and inventory_code in your data source?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
192 | |
67 | |
46 | |
41 | |
22 |
User | Count |
---|---|
252 | |
121 | |
84 | |
80 | |
72 |