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

Data Table not Refreshing

I think I must have some bug with the Data Table.

I put a data table and a gallery right next to each other on the same screen and bound them to same collection. When I patch the collection, the gallery will reflect the update but the data table doesn't. If I ClearCollect the collection, then the data table updates along with the gallery. Has anybody run into this or know what might be happening?
16 REPLIES 16
mr-dang
Level 10

Re: Data Table not Refreshing

Hi @mryckman

I'm not experiencing the same as you are. Can you share more about your setup and a sessionID?

 

powerapps - gallery datatable.gif

 

Mr. Dang

Microsoft Employee
@8bitclassroom
mryckman
Level: Powered On

Re: Data Table not Refreshing

Thanks @mr-dang... Here's the other stuff I've found... 

 

  • I'm doing ClearCollect on a different screen. If I do it on the same screen, it works as expected. 
  • The relevant code is refreshing from a SQL table... here's the line:
    • ClearCollect(SelectedLoadSchedule,Filter('[dbo].[LoadSchedule]',LoadID = ThisItem.LoadID));Navigate(screenLoadDetail,ScreenTransition.Cover,{Return: screenLoads})
  • It looks like it works the first time - so the first LoadID I drill into works, but the second doesn't. 
  • At first I thought it was just with Patch, but it looks like ClearCollect isn't working now either - at least not on the second/subsequent calls.

I'm not sure how to send my session ID. I could PM you my phone number or something if that would help.

 

mr-dang
Level 10

Re: Data Table not Refreshing

@mryckman

Thank you for providing more information on your setup. I was able to replicate the issue with those steps.

 

For future reference, you can get a session id with these methods:

https://aka.ms/pa/sessionid

 

I'll let you know what I find out.

 

 

Mr. Dang

Microsoft Employee
@8bitclassroom
Community Support Team
Community Support Team

Re: Data Table not Refreshing

Hi @mryckman,

 

Could you please share a bit more about your scenario?


@mryckman wrote:




The relevant code is refreshing from a SQL table... here's the line:
  • ClearCollect(SelectedLoadSchedule,Filter('[dbo].[LoadSchedule]',LoadID = ThisItem.LoadID));Navigate(screenLoadDetail,ScreenTransition.Cover,{Return: screenLoads})







Could you please show a bit more about the screenLoads within the formula that you provided?

 

I have made a test and the issue is confirmed on my side. It seems that the Return context variable has not been passed to the Data table control within your another screen.

 

As an alternative solution, please take a try with the following workaround:3.JPG

 

4.JPG

 

 

Set the OnSelect property of the Navigate button to following formula:

ClearCollect(SelectedLoadTask,Filter('[dbo].[TaskLists]',TaskName=ThisItem.TaskName));Navigate(Screen2,ScreenTransition.Fade,{PassedTask:SelectedLoadTask})

On your side, you should type the following formula:

ClearCollect(SelectedLoadSchedule,Filter('[dbo].[LoadSchedule]',LoadID = ThisItem.LoadID));Navigate(screenLoadDetail,ScreenTransition.Cover,{Return: screenLoads})

 

Within the screen (screenLoadDetail screen) which contains the Data table control, set the OnVisible property to following formula:

ClearCollect(ReceivedTask,PassedTask)

On your side, you should type the following formula:

ClearCollect(ReceivedSchedule,Return)

 

Set the Items property of the Data table control within above screen (screenLoadDetail screen) to following formula:

ReceivedTask

On your side, you should type:

ReceivedSchedule

The GIF image as below:Test1.gif

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mryckman
Level: Powered On

Re: Data Table not Refreshing

Thanks Kris... Here are a few more details:

 

  • The data table on screenLoadDetail is bound to SelectedLoadSchedule
  • The {Return: screenLoads} is just a way of telling screenLoadDetail where to send the user back to because it links off to some other places in odd ways. So, screenLoadDetail's "back" button has this code: If(IsBlank(Return),Back(),Navigate(Return,ScreenTransition.Cover))
  • The screen that's calling this button - the screen with the "ClearCollect(SelectedLoadSchedule..." - is screenLoads
  • I tried removing the "{Return: screenLoads}" entirely and still have the same problem
  • SelectedLoadschedule is definitely getting updated. If I close out of the app after getting to screenLoadDetail and look at the collections list in the settings, it shows the correct data. Also, if I put a gallery on screenLoadDetail using SelectedLoadSchedule as its Items property, it works as expected
  • This seems to be a factor of the data table itself. Any other way where I update the SelectedLoadDetail collection from another screen doesn't seem to update the data table either. For example, on another screen, I Patch that collection and, again, the collection updates... but the data table doesn't show it

Does that help more? I could setup a screen sharing session or something if that'd be useful.

 

Thanks for your help.

mr-dang
Level 10

Re: Data Table not Refreshing

Hi @mryckman,

Update 3.18072 is currently rolling out now that fixes the issue of the data table not updating like the gallery would on different screens. It may take some time to reach your region. Once you get the update, please confirm on your side.

 

Mr. Dang

Microsoft Employee
@8bitclassroom
mryckman
Level: Powered On

Re: Data Table not Refreshing

Thanks @mr-dang! I don't think the update has come to me yet... I'm using the web editor, so I'm not sure how to tell, but my installed version is still showing a slightly older one. I'll keep an eye out and let you know.

Anonymous
Not applicable

Re: Data Table not Refreshing

Hey @mryckman! It's Bryan over at SB, I am experiencing the same issue where a clearcollect on a previous screen does not get reflected on the datatable.

 

@mr-dang My app version is currently 3.18072.29.  Is this not the version that is suppose to correct this?

Anonymous
Not applicable

Re: Data Table not Refreshing

Changing the clearcollect to onvisible does address the issues as a workaround FYI.