web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sharepoint Write failures
Power Apps
Unanswered

Sharepoint Write failures

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've been struggling with this for months and have not come up with a solution. I am caching data from a Sharepoint list called PSO in a local collection called PSOCache. I have a "SyncState" field which is set to 0 when a record is edited in the app, 1 when it is written back to PSO, and then set to 2 when the record is updated in Flow.

 

Sometimes but not always, updates get "lost" and the record reverts to its previous values. New records never seem to get "lost". Below is the relevant code in an icoWriteBack.Select. This is called from OnVisible for my gallery screen, in other words after the user creates or updates a PSOCache record in the New/Edit screens. The gallery displays filtered records from PSOCache. 

If(Connection.Connected
&& Concat(PSOCache,If(SyncState=0,"1",""))<>""
,UpdateContext({IsSyncing:true}) ;ForAll( PSOCache // Update all cached edits back to db ,If(SyncState=0 ,If(IsBlank(ID) ,Patch(PSO ,Defaults(PSO) ,{ MSF: PSOCache[@MSF] ,Inspected: PSOCache[@Inspected] ,Status: PSOCache[@Status] ,Bin: PSOCache[@Bin] ,Description: PSOCache[@Description] ,OwnerName: PSOCache[@OwnerName] ,OwnerAlias: PSOCache[@OwnerAlias] ,SN: PSOCache[@SN] ,VPN: PSOCache[@VPN] ,Ticket: PSOCache[@Ticket] ,StatusText: PSOCache[@StatusText] ,StatusDetail: PSOCache[@StatusDetail] ,SyncState:1 } ) ) ;UpdateIf(PSO ,PSO[@ID]=PSOCache[@ID] ,{ MSF: PSOCache[@MSF] ,Inspected: PSOCache[@Inspected] ,Status: PSOCache[@Status] ,Bin: PSOCache[@Bin] ,Description: PSOCache[@Description] ,OwnerName: PSOCache[@OwnerName] ,OwnerAlias: PSOCache[@OwnerAlias] ,SN: PSOCache[@SN] ,VPN: PSOCache[@VPN] ,Ticket: PSOCache[@Ticket] ,StatusText: PSOCache[@StatusText] ,StatusDetail: PSOCache[@StatusDetail] ,SyncState:1 } ) ) ) ;UpdateIf(PSOCache ,SyncState=0 ,{SyncState:1} ) ;SaveData(PSOCache,"PSOCache") ;UpdateContext({IsSyncing:false}) )

Another icon, icoSyncing, is selected either manually or every 5 seconds.

If(Connection.Connected && !IsSyncing
 ,Select(icoWriteBack)
 ;UpdateContext({IsSyncing:true})
 ;ClearCollect(PSOCache
 ,Filter(PSO
 ,StatusText = "Pending Pickup"
 || StatusText = "Tech Custody"
 || SyncState <> 2 // records that have not been updated by the "Flow"
 ,OwnerName = UserName
 || OwnerAlias = UserAlias
 )
 )
 ;SaveData(PSOCache,"PSOCache")
 ;UpdateContext({IsSyncing:false})
)

When the issue occurs, I can see the gallery shows the new values, that the IsSyncing field gets updated, then when icoSyncing.Select runs, the record reverts. This indicates to me that the write failed; the original data from Sharepoint is overwriting the data in PSOCache.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @sopatte are you still experiencing this issue?

     

    @Anonymous 

  • SoPatt Profile Picture
    Microsoft Employee on at

    Yes, as of yesterday

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard