Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Accidental rewriting existing items in SPO List

(1) ShareShare
ReportReport
Posted on by 832

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)

 

 

  

  • Sifu Profile Picture
    832 on at
    Re: Accidental rewriting existing items in SPO List

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard