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)
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
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional