Hello,
I have an app tied to SharePoint site. All is working yet I am having an issue with the data reflecting in real time to the app when an update is made. Here's the run down.
All is working yet when the approval or rejection is made the status does not show in the app till I refresh the data. So I am thinking I was going to add formula to reset data source once button is pressed unless I can find a way to have the app refresh every second as multiple users will use this to make approvals at the same time, also do not want someone to make a change and not see it was made. I will also be disabling the button once the cell shows a status is updated.
Any assistance will help. Thank you for your time.
Solved! Go to Solution.
Yes, that was only part of it! You needed to also do a Refresh on the datasource after that formula.
So...
UpdateContext({flowRes:Approved.Run(Accrualinfo.Selected.ID,Commentbox)});
Refresh(yourDataSourceName)
Assuming then that you are referring to changes made outside of your app (i.e. user approves/rejects from another app or means). If so, then your best bet would be to provide a refresh on the datasource in timed refreshes. Doing so every minute might be overtaxing on your app, as refreshes are "expensive" on performance.
To do this on a timed basis, add a timer control to your app and set the duration to 60000 which will be every minute. Then in the OnTimerEnd action, place the following formula: Refresh(yourDataSourceName)
If you find that this becomes a burden on your app to constantly refresh, then you might also consider doing a revert on individual records.
I hope this is helpful for you.
Hello Randy,
Thank you for responding. Is there a way I can have the data refresh when they press the approve or reject button? No changes will be made outside of the app as they are going to depend on the app to be the only source of approval.
Then I'm a little confused....when you update a datasource within your app, the datasource will immediately reflect the change you just made. There is no need to refresh the datasource.
The only time you need to consider refreshing the datasource is when some other method is used to change the datasource outside of your app - like a flow, another user in another or the same app, someone directly interacting with the data list, etc.
Actually there is a flow tied to it. The buttons are tied to a flow, the flow sends change to list and adds comment, then it emails a response to the supervisor and the accruer with the status. I have a gallery on the left that displays the tickets which once selected shows the detailed information on the right side as this is a web based app. Was trying to have a fluid app that does not have to change screens between. I am also trying to figure out how to clear out the comment box once button is pressed and a couple other features, but that a different story. I had to refresh to get this data to display after I hit the button.
Yes, so the flow is external and will update the list outside of the app.
In this case, I would set a formula to execute your flow run and store the result in a variable.
ex.
UpdateContext({flowRes: yourFlowName.Run(params)})
This will cause your app to wait for the complete execution of the flow run.
Then immediately after that, either do a full Refresh on the datasource, or Revert the record to only update that one in your datasource.
It did not work. Here is the formula I entered.
UpdateContext({flowRes:Approved.Run(Accrualinfo.Selected.ID,Commentbox)})
It still runs but does not refresh data source.
Yes, that was only part of it! You needed to also do a Refresh on the datasource after that formula.
So...
UpdateContext({flowRes:Approved.Run(Accrualinfo.Selected.ID,Commentbox)});
Refresh(yourDataSourceName)