Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Answered

FetchXML returning old data

(0) ShareShare
ReportReport
Posted on by 34

Is there a way for FetchXML to return the most up-to-date data from a table?

I've got a page that runs FetchXML when it loads. It looks at a Dataverse table and returns some specific values (employee number, a choice, department number). The page will display certain things depending on the value of the choice. This is done through liquid. The problem is, the choice can change when the user is on that page. If it does change and the page is reloaded, it's still grabbing the old choice value and not the new one. It shows the change in Dataverse though. It takes 5+ minutes for the FetchXML to get the most recent data.

 

Is this something that can be immediate?

Categories:
  • ShaneHubble Profile Picture
    34 on at
    Re: FetchXML returning old data

    Thanks for the suggestion. Adding 

    <condition attribute='modifiedon' operator='on-or-before' value='{{ 'now' | date:'MM/dd/yyyy HH:mm:ss' }}'/>
    fixed the issue. It now pulls the most recent data for the user.
  • Verified answer
    Fubar Profile Picture
    7,964 Super User 2025 Season 1 on at
    Re: FetchXML returning old data

    Your queries will pull data from the Portals Cache which is why you see data where the data has been added/updated in Dataverse and not yet updated in the Cache (which takes a couple of minutes).

    Note: It is not recommended by Microsoft to break the Cache, but you can if you are querying the data yourself (you can't if using a standard view), what you do is add a condition into your fetchxml that includes date-time down to seconds (e.g. createdon is less than or equal to today).  Basically this makes your query a bit more unique (except for another user making the same query in the same second) and so will pull the data from Dataverse.

     

    (I don't have it at hand, but you will find this has been answered with an example in the past)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43