cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ebraga
Helper III
Helper III

Is it possible to update a form and a collection to sharepoint in one button click?

Hello All,

 

My app is as follows: A user submits a delivery request on screen 1, then a truck driver goes in and updates delivery information on screen 2 of the app. One line item in SP contains the delivery request with delivery information.

 

I am trying to update a SharePoint item (using form2.updates) while also pushing a collection update. Is this possible? When I use the following Patch function, the collection item is not updated. (Url)

Patch('Transfer Sheet & Product Availability',If(Form1.Mode=FormMode.View,SharePointIntegration.Selected,Form1.Mode=New,Defaults('Transfer Sheet & Product Availability'),{Url:First(LocalImage).Url}),Form2.Updates)

 

The only time it works is if I use a separate submit button for the collection, but then at that point, the collection data creates a new line item instead of updating the one that has been opened/viewed. Patch('Transfer Sheet & Product Availability',Defaults('Transfer Sheet & Product Availability'),{Url:First(LocalImage).Url})

 

Is there any way I can merge these two functions? 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,


I switched the Form2.Updates and put it before the collection update.

 

 Patch('Transfer Sheet & Product Availability',If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected), Defaults('Transfer Sheet & Product Availability'),SharePointIntegration.Selected),Form2.Updates,{Url:First(ImageUpdates).Url})

 

The formula now works and populates correctly. Thanks for your help!

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @ebraga :

Please try this formula:

Patch(
  'Transfer Sheet & Product Availability',
  If(
     IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
     Defaults('Transfer Sheet & Product Availability'),
     SharePointIntegration.Selected
    ),
  {Url:First(LocalImage).Url},
  Form2.Updates
)

Best Regards,

Bof

Bof,

This formula still does not populate the Url field in the Sharepoint list. However, when it stands alone in the function: Patch('Transfer Sheet & Product Availability',Defaults('Transfer Sheet & Product Availability'),{Url:First(Local Image).Url}) it updates. Why do you think this is happening? 

Hello,


I switched the Form2.Updates and put it before the collection update.

 

 Patch('Transfer Sheet & Product Availability',If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected), Defaults('Transfer Sheet & Product Availability'),SharePointIntegration.Selected),Form2.Updates,{Url:First(ImageUpdates).Url})

 

The formula now works and populates correctly. Thanks for your help!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,680)