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 / Accidental rewriting e...
Power Apps
Unanswered

Accidental rewriting existing items in SPO List

(1) ShareShare
ReportReport
Posted on by 834

Hello guys,

i have an app where users can create a request that is recorded to SharePoint list. It has draft or publishes state and allows the user also to delete the request if required...

to create a new request the button goes:

 

 

ResetForm(Form1); NewForm(Form1);
Refresh('sip');
Patch('sip', Defaults('sip'),
{
 Status:{Value:"Draft"},
 Title: Company.Selected.Title
});

//refresh and select last item
Set(varID, First(Sort('sip', ID, SortOrder.Descending)));

//this will ensure the button to "add product" is visible and form is editable
EditForm(Form1);

 

 

to save the draft:

 

 

Patch('sip', LookUp('sip', ID = ThisItem.ID),
{
 Status:{Value:"Draft"},
 Title: Company.Selected.Title
},
 Form1.Updates
);

 

 

 to submit (also triggers a flow)

 

 

Refresh('sip');
Patch('sip', LookUp('sip', ID = ThisItem.ID),
{
 Status:{Value:"In Progress"},
 Title: Company.Selected.Title
},
 Form1.Updates);
//trigger flow
'sip-1Newcase'.Run(ThisItem.ID);

//change view and navigate to success screen
ViewForm(Form1); Navigate(success)

 

 

 

The trouble i have, is that sometimes, one user will overwrite other users request... i can see that even in version history of SPO that "Jack" created some draft but "Jil" changed it... the gallery that shows their drafts has items as following (filtered by upn in a dedicated column...)

 

 

Sort(Filter('sip',CreatedbyUPN=createdbyupn.Text And galleryfilterstatus.Selected.Value=Status.Value),Modified,SortOrder.Descending)

 

 

  

Categories:
I have the same question (0)
  • Sifu Profile Picture
    834 on at

    one issue i just spotted is (not filtering for user rather general first):
    //refresh and select last item
    Set(varID, First(Sort('sip', ID, SortOrder.Descending)));

     

    new approach

    Set(varID, First(Sort(Filter('sip',CreatedbyUPN=createdbyupn.Text), ID, SortOrder.Descending)));

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 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard