cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StewG
Helper I
Helper I

Patch

Hello,
I have built an app to process orders placed in our department. It is supported by SharePoint Lists with 2 key lists holding all the data.
'Purchase Order Master' SharePoint list holds all the key overview information about the order including the 'TotalCost' of the order. (All the items added together).
There is also an Items SharePoint list which holds all the information for each individual item that makes up the order including its 'TotalPrice'.
These are displayed as Galleries in the app and are linked by their ID number.

I have already built in an EditForm where I can amend the 'TotalPrice' of an existing item in the Items Gallery and it will use Patch to update the 'TotalCost' in the Master Gallery. This all works fine and as expected.

 

Edit Item - EditForm_2

 

OnSuccess

Patch(
'Purchase Order Master',
MasterGallery_2.Selected,
{TotalCost: Value(TotalPriceChange_2.Text)}
);


As a development I have created a New Item Form (Form4) where I can add in a new item to the existing Order.
I am able to add the New Items 'TotalPrice' to the Master Gallerys 'TotalCost' and show the correct number.
Using the formula below

 

MasterGallery_2.Selected.'Total Cost' + NewTotalPrice

 

The issue I am having is I can not get it to update the Master List with the updated 'TotalCost' as it would with the 'EditForm'. I am using a similar formula but it resets the Master Lists 'TotalCost' to 0 (zero) every time.

 

New Item - Form4

 

OnSuccess

Patch(
'Purchase Order Master',
MasterGallery_2.Selected,
{TotalCost: Value(TotalPriceChange_4.Text)}
);


I have been working on this for a few days now and can not get my head round why it is not working. Any help would be great.

Thank you.

1 REPLY 1
SeanHenderson
Impactful Individual
Impactful Individual

I've moved this to the Building Power Apps forum, as it's not related to Dataverse.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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