cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Issues with refreshing CDS collection data

I am pulling my entity data into collections (to avoid the delegation issues) but I am getting really bad syncing issues. My experience is mostly with SharePoint lists and I am using a similar approach to refresh my entity data. My code on the buttons on my app is:

 

Refresh(Tasks);
ClearCollect(taskscol, Tasks)

 

I am then filtering a gallery, using the code: Filter(taskscol, Lower('Assigned To'.'Full Name') = Lower(User().FullName))

 

My data is showing perfect when I look at it in the Entity but it isn't refreshing properly in my app.

3 REPLIES 3
Highlighted
Community Support
Community Support

Hi @sammybridge ,

 

By "it isn't refreshing properly", where did you update the data? From inside this app or from CDS site? Did you make sure that the edit form that you use to update the entity is connect to the entity not the collection?

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hello @v-monli-msft ,

 

I have updated the data using a NewForm on the app. I am trying to refresh my data within the app alone to view the data I have pushed in but the gallery isn't showing the data properly.

 

I have made a view in my Entity which does the Filter for me and it is working better but I am still getting Refresh lags. Is there anything else I should be doing to Refresh and Collect my data?

 

Cheers

Highlighted
Super User
Super User

I was having the similar issues - patching a record, issuing a refresh, then using a LookUp to grab the record and assign to a variable.

Looks to me like the commands are running asynchronously , so the Refresh is still running when the LookUp tries to get the data, so the old record data is assigned to the variable instead.

There may also be issues around the screen deciding it does not need to refresh the data again even though you repeatedly try to refresh from a button or the data source list. I found I could refresh all day long on the same screen and never get the new data, but if I moved to a different screen and then back, the refresh would work (fetch the latest data).

I ended up putting in a 'Save' screen. After the patch, I navigate to the 'Save' screen (just says 'Saving Data') which has a one second timer and then returns to the original screen (which has a Refresh on the OnVisible).

Where possible I also moved away from assigning the data to variables and just displaying it in labels with LookUp formulas. 

Shouldn't be necessary but for me it was a reliable solution.

If you are coming from SharePoint (or particularly SQL) CDS peformance is really poor. In my case I think there were also some 'jobs' which run when data in some entities is updated (because CDS doesn't have proper relational views so often a developer adds workflows to replicate data between entities so it can be reference more easily).

If you don't need up-to-the-second data, check if your organisation syncs the CDS data to SQL. I had a process that was pulling data from CDS that took 15 minutes - moved to accessing the same data from SQL and got the reponse time down to 6 seconds.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (9,553)