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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard