cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Show Live Data on Powerapps Portal

Hi All,

My requirement is-
I am sending an email to specific contacts then the receiver will be having a notification system, so when the receiver receives it then it should notify the user without refreshing the page as shown below image.

Tejasvi_munge_0-1612504709936.png

 

I know we can do something like- insert data into CDS, refresh the page get it display on front page but I don't want that I want it to be Live.
Note: in .net we can use a socket and achieve this. Do we have something like this in powerapps portal? 

How can I achieve that?

 

5 REPLIES 5
justinburch
Microsoft
Microsoft

Hi @Anonymous,

The same way you'd any other implementation, with the caveat it'll need to be client-side (JS): you'd need a Publish-Subscribe model. Ultimately, you need to add JS to your Portal to 'listen' for updates client-side, client-side functionality to show the updates, and a server-side push to these subscribers. I don't personally have experience implementing it, because there's typically complexity there - maybe this Google doc for a subscription API using JavaScript's Notification API could help.

 

A simpler implementation might be your very recommendation of just using records in CDS, but have (perhaps in your header) a small JS timer to query for new 'notifications' every 30s or few minutes or so. Keep in mind that you might still need to think of a way to store if this particular user has already seen this notification, unless it persists for X amount of time or you don't care about it showing on each query/page.

Fubar
Solution Sage
Solution Sage

Be mindful that if you are essentially polling CDS/Dataverse that each poll will be a API request and depending on your users licencing (including if they are Internal vs External users) you may very well find that you exceed the daily API limits.

 

If the API limits are a problem you would probably have to come up with a complicated mechanism such as you have Ajax on your site talking to Azure (probably via the Oauth explicit grant flow functionality), code in azure then polling an Azure Service Bus to check if a new message has arrived (or working with Listener).  And code on the Dataverse side to push to the Azure Service Bus when the update (response/receipt ) occurred in Dataverse. (and there are probably a number of technical challenges and of course additional costs to overcome with something like this also)

 

Wouldn't it be easier to just send the Contact an Email or SMS?

 

Anonymous
Not applicable

Hi @justinburch  ,

I understood that we need to implement it as Publish-Subscribe model but where do we subscribe to on powerApps? For .net we can have a socket open from the backend and listen to it using signalR client library but I'm not seeing any part of powerApps that can emit events and I can subscribe to it from the client.

Hi @Anonymous, I'm not aware of any capability built directly that you could leverage, as my limited experiences involved Azure resources.

Fubar
Solution Sage
Solution Sage

There is no current PowerApps Portal publish/subscribe functionality - and you have to be mindful of the API limits if you are just polling Dataverse/CDS, that is why I suggested what I did as it is a way you could potentially make it work. 

(The one thing you can do is make Entity Lists RSS feeds, but as per the doco this is not secure and should not be used for any thing that should not be publicly available)

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,352)