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

CDS updated data not reflecting after it's updated by the user, using Liquid code or Directly in Entity list

Hi Experts,

 

I am facing one weird issue related to data fetch via liquid code or displaying data in entity list.

The scenario is like below:

1. When Users insert a new record to the entity then it is coming fine in Entity List and while fetching from Liquid code.

2. But when the same record is updated by the users, let's say publishing state from Draft to Published. then it is not reflecting that updated value in entity list or even while fetching from liquid code.

3. When I edit the Portal App, and click on the sync Configuration then after login again it starts showing the updated value both in Entity List and via Liquid code.

 

Why this is happening? is this the way it behaves? Any fix I can apply to resolve this issue?

 

Please help me with this issue.

Thanks,

Amit

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Supplier
Solution Supplier

Re: CDS updated data not reflecting after it's updated by the user, using Liquid code or Directly in Entity list

Hi @AmitSah,

It sounds like you're facing a cache issue. In order to maintain performance, the Portal will cache all queries to Dynamics - this means that any data updated outside of the Portal (in CRM/CDS, via power automate, etc.) may not reflect. You can see some odd behavior by changing the sort order of your list (only works the first time, as each sort is a query - so it'll cache subsequent queries).

E.g.:

  1. Entity List shows 4 records
  2. User updates record 1, which triggers Power Automate to create a new record (record 5)
  3. Entity List still shows 4 records
  4. User clicks Name to change from ASC to DESC sort order
  5. Entity List now shows 5 records
  6. User clicks Name again to change back to ASC sort order
  7. Entity List now shows 4 records again

There are a few tips you can utilize to try to force this cache to be less frustrating:

  1. Make sure all entities utilized have Change Tracking enabled
  2. Try to handle all non-Portal updates with synchronous code
  3. Try to update from Portal - e.g. if possible, use "On Submit" Entity Form Metadata to set fields the user isn't setting
  4. If retrieving from code, make the call unique by adding something random - e.g. if you're doing a Web API retrieve, in your fetchxml tag, add a condition like:

 

<condition attribute="new_name" operator="ne" "{{ params.dt }}">​

 

Where dt was passed as a simple "new Date()"

I hope this helps,

Justin

View solution in original post

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: CDS updated data not reflecting after it's updated by the user, using Liquid code or Directly in Entity list

Hi

 

What you are facing is common and that's basically a caching issue.

You don't see the issue in your scenario 1 because it all runs in the same transaction, the Portal updates CDS data and invalidates the cache at the same time.

When updating data first in CDS, it might take up to 15 min for the cache to be cleared. Please refer to this post for more caching tips: http://oliverrodrigues365.com/2020/07/27/power-apps-portals-caching-tips/

 

For fetch/liquid you can add the timestamp condition and that should solve partially your problem


------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Highlighted
Solution Supplier
Solution Supplier

Re: CDS updated data not reflecting after it's updated by the user, using Liquid code or Directly in Entity list

Hi @AmitSah,

It sounds like you're facing a cache issue. In order to maintain performance, the Portal will cache all queries to Dynamics - this means that any data updated outside of the Portal (in CRM/CDS, via power automate, etc.) may not reflect. You can see some odd behavior by changing the sort order of your list (only works the first time, as each sort is a query - so it'll cache subsequent queries).

E.g.:

  1. Entity List shows 4 records
  2. User updates record 1, which triggers Power Automate to create a new record (record 5)
  3. Entity List still shows 4 records
  4. User clicks Name to change from ASC to DESC sort order
  5. Entity List now shows 5 records
  6. User clicks Name again to change back to ASC sort order
  7. Entity List now shows 4 records again

There are a few tips you can utilize to try to force this cache to be less frustrating:

  1. Make sure all entities utilized have Change Tracking enabled
  2. Try to handle all non-Portal updates with synchronous code
  3. Try to update from Portal - e.g. if possible, use "On Submit" Entity Form Metadata to set fields the user isn't setting
  4. If retrieving from code, make the call unique by adding something random - e.g. if you're doing a Web API retrieve, in your fetchxml tag, add a condition like:

 

<condition attribute="new_name" operator="ne" "{{ params.dt }}">​

 

Where dt was passed as a simple "new Date()"

I hope this helps,

Justin

View solution in original post

Highlighted
Helper V
Helper V

Re: CDS updated data not reflecting after it's updated by the user, using Liquid code or Directly in Entity list

Hi @justinburch @OliverRodrigues 

 

Thanks for your response.

It helps me to resolve the issue.

 

Thanks,

Amit

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (6,566)