cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Patch function on save is doing a Create and update on the sharepoint list

Hi,

I am using a power app form which is connected to a SharePoint list (data source). On the sharepoint list I have two power automate flows running

  1. Triggers an email when a new item is created
  2. Triggers an email when an item is modified

OnSave functionality of the PowerApp has the following code snippet

 

 

 

Set(mergedValue,Patch(
        NewForm.Updates,
        {
            RequestStatus0: {
                Value: If(
                    IsBlank(DataCardValue42.Selected.Result),
                    "New Request",
                    DataCardValue42.Selected.Result
                )
            }
        }
    ));
Patch(
    SharePointList,
    Defaults(SharePointList),
    mergedValue
);
ResetForm(NewForm);
RequestHide();

 

 

 

I am using NewForm.Updates to capture the attachments added to the form and "request status" column dropdown menu is using a secondary Sharepoint list .

 

Even though I have written this snippet to just create a new record on the SharePoint list it is triggering both the flows (create and modify). Is there a better way to implement this?

1 REPLY 1
Sandy_Shine
New Member

I met this kind of issue, using sharepointform1.displaymode to diagnose when it is creating mode or edit, but it failed, the display mode is always 'edit'. How can use 'path' to submit a new record via integrate powerapps.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,516)