Data view not refreshing in snippets

Hi Community,   I have created a snippet for navigation in which I am a navigation tree and a data view and this data view displays an open notification value or open task value. But this notification is not updating as the open task is closed in a dynamic time. This is updated once I refresh the application from browser or move to next screen. Screenshot of Navigation Snippet.   How can I resolve this?   Thanks and Regards, Harshraj Singh
4 answers

Hi Harshraj,


Use a microflow timer to refresh the notification count. Call a microflow that calculates the notification from the Microflow timer widget. 


Check the Documentation 


Hi Harshraj,

Probably, you can make an attempt with the ‘refreshClass’ and ‘refreshClassByObject’ MFs from the Community Common module. These MF shall be invoked before changes (like a subscription for the change).
Based on your screenshot, you need invoke it for OpenFormsCountEntity entity.
However you also have to make real modifications in the related instances, because if you only regenerate the object then the there will not be changes in the existent objects which the client should refresh.

Anyway, I agree with Dinesh that you should deal with the context object of the snippet. Refreshing the context triggers to invoke the MF sourcing the dataview. 



Update :

Hi Harshraj,

I Agree with you, the DS microflow is not Retriggered even when the context object is refreshed, which is weird behavior. Might be because it is inside a snippet, Not sure about the correct reason. 

But I tried to make it work with a small tweak. You could give it a try .

Steps I performed :

  1. Add a new NP helper object and associate it with your Notification Object. 
  2. In your Snippet Add a Data view at the top with Data the source as Microflow and then Retrieve/Retrieve your Notification object, Create your NPE object, and set the Association between the notification object.
  3. Add a microflow timer widget in the Data view and and see the screenshot below for the widget setting.
  4. The Microflow parameter will be the NPE object, now Add your notification update logic here and Refresh the Notification object.
  5. Add another data view inside the first data view, the source will be Context, and select your Notification object via association.

This Worked for me. Refer to the screenshots below. Try and let me know :) 

Ds flow for first Dataview :


Widget Setting :


Widget Microflow :


Second Data view Data source Setup : 


Good Luck !!!!


Let me know if it works for you. Adding a new Answer since I  cannot add Screen shots in the comment.


Hello Harshraj,


I am not sure where this snippet is placed in your app but you can use GetCurrentUser microflow on the page and place this snippet within it making the Account entity an input parameter for both snippet and the microflow.


When you save any open task retrieve the current user and without making any changes just refresh in client and it will work.