cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Continued Contributor
Continued Contributor

Gallery not updating in real time.

Hi,

 

I am currently having an issue with Dynamics as a data source.

 

I have an app, which enables a user to add a new weight measurement for an animal.  The weight is a custom entity on D365, and is linked to the animal, another custom entity. Within the animal entity, there is a field called Current Weight Date, which populates itself from the most recently added weight linked to that specific animal from the Weight entity.

 

Adding a new weight works fine, and listing old weights also works perfectly. 

 

I am trying to get the animals that have already been weighed on a day to remove from the gallery of animals but this is currently not working. I have checked the entries, and they are populating D365 as expected, and filling out the related field, but the gallery is not updating in real time.

 

The gallery does not refresh when navigating back to the gallery after adding the weight, and also does not work on the click of a refresh button, which is set to refresh both the Weight and Animal entities as data sources. The Refresh function is in the formula of the navigation after the weight is added as well.

 

The gallery only updates if a user exits the list of animals back out to a previous screen which chooses the barn where the animals are located, and re-selects the barn. The gallery then does not show those animals with a Current Weight Date of today.

 

The back and forth is really not practical, as some barns hold well over 100 animals.

 

The gallery items formula is as follows;

 

SortByColumns(Filter(Animals,currentbarnid_value='FS Barn Dropdown'.Selected.barnsid && 'Current Weight Date'<> Today() && StartsWith(animal_name,'FA Text Search Box'.Text)),"animal_name")

 

Can someone shed any light? Any assistance is appreciated.

 

Matty

2 REPLIES 2
Dual Super User II
Dual Super User II

Hey @MattyH 

 

Can you try to create a variable to handle the barn selection on the previous screen. This way you can set the variable as blank and then reset it again.
 
Barn Dropdown:
OnChange -> Set(SelectedBarn, 'FS Barn Dropdown'.Selected.barnsid)
OnSelect -> Set(SelectedBarn, 'FS Barn Dropdown'.Selected.barnsid)
 
When you save the new weight details:
Refresh(Weight);Refresh(Animals);Set(SelectedBarn,Blank());Set(SelectedBarn,'FS Barn Dropdown'.Selected.barnsid)
 
I assume that the dropdown is not reset during this process.
 
Gallery Items:
SortByColumns(Filter(Animals,currentbarnid_value=SelectedBarn && 'Current Weight Date'<> Today() && StartsWith(animal_name,'FA Text Search Box'.Text)),"animal_name")
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Continued Contributor
Continued Contributor

Hi @yashag2255 ,

Thanks for the swift response. I have tried your suggestion, and still getting the same issue. The weights are adding, and are listed in the correct order, but those animals weighed today are not removed from the gallery list.

 

Thanks

Matty

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (9,479)