cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ward_1984
Frequent Visitor

Check Modify sharepointlist

Hi,

 

Because i have a app that is used by different users at the same time i was trying to warn powerapp if the sharepointlist is updated.

 

Now i had 3 different scenarios in mind.

 

1. I run a flow as soon a new item is created in the sharepoint list. But i think the problem is that i can warn powerapps if i didn't started the flow in powerapps. Or am i wrong and there is a way?

 

2. I start a flow every minute (or shorter) and check if the sharepointlist is updated (and remember every run the previous modify date). I figured it out to check the column modify but then i have to check every item to see if the modify date is different. And i don't find where i can check the modify of the entire list. Is this possible?

 

3. I start the flow and stay in this flow until the sharepointlist is changed (i thought through a do until) and then it send it back to powerapp. But again i don't know how to check the modify date of the sharepoint list.

 

Thanks at advance!

Kind regards,

Ward

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @Ward_1984 ,

The easiest way is to to a lookup to the item in the list before you save and if the modified date and time is not the same as the modified date and time of the item you have (which is what you mentioned), then it has been changed.

If the item was selected from a gallery

If(
   Text(
      LookUp(
         ListName,
         ID=GalleryName.Selected.ID
      ).Modified,
      "hh:mm:ss"
   ) <>
   Text(
      GalleryName.Selected.Modified,
      "hh:mm:ss"
   ),
   Notify("Item has been modified since you opened it",Error)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

 

View solution in original post

R3dKap
Super User
Super User

Hi @Ward_1984,

Unfortunately, Power Apps cannot "know" when a datasource has been modified. That is why we usually use the Refresh() function to make sure the datasource is up to date. Even if you make a flow that changes something to your SharePoint list, if you don't do a Refresh() in your app, it will not know that your data has changed.

The only way to make an app really "real-time" would be to use SignalR technology (I've never done it myself).

So, the questions are:

  1. Why do you really want to notify all users that are using the app that the SharePoint list is updated?
  2. Why not provide the user with a refresh icon?

View solution in original post

4 REPLIES 4
WarrenBelz
Super User III
Super User III

Hi @Ward_1984 ,

The easiest way is to to a lookup to the item in the list before you save and if the modified date and time is not the same as the modified date and time of the item you have (which is what you mentioned), then it has been changed.

If the item was selected from a gallery

If(
   Text(
      LookUp(
         ListName,
         ID=GalleryName.Selected.ID
      ).Modified,
      "hh:mm:ss"
   ) <>
   Text(
      GalleryName.Selected.Modified,
      "hh:mm:ss"
   ),
   Notify("Item has been modified since you opened it",Error)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

 

View solution in original post

@WarrenBelz. thanks for the reply

 

It wasn't that obvious in my post but what i meant was that when a other user made a new item it got refresh with the other users.

 

And your solution checks the item before you update it. Which is actually also useful 😁.

 

But the most important was the new items so is there also a way to do that, without refreshing the list every prefixed interval?

R3dKap
Super User
Super User

Hi @Ward_1984,

Unfortunately, Power Apps cannot "know" when a datasource has been modified. That is why we usually use the Refresh() function to make sure the datasource is up to date. Even if you make a flow that changes something to your SharePoint list, if you don't do a Refresh() in your app, it will not know that your data has changed.

The only way to make an app really "real-time" would be to use SignalR technology (I've never done it myself).

So, the questions are:

  1. Why do you really want to notify all users that are using the app that the SharePoint list is updated?
  2. Why not provide the user with a refresh icon?

View solution in original post

Ward_1984
Frequent Visitor

hi @R3dKap 

 

It not of the utmost importancy (i first did it with the refresh button) but my superior asked me to look into it if it would be possible to do it automatically.

 

Thanks for the reply, now i can give my superior the option of doing the refresh through a timer, every page change or refresh button.

And when i update a item i will use the code of @WarrenBelz

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (22,211)