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

(Patch has invalid arguments) Patching a SharePoint List

I'm trying to patch a sharepoint list using two dropdown menus but I've been getting "Patch has invalid arguments".

 

This is my line of code for the patch button:

Patch('FST,Defaults('FST'),{'Furnace Process':drpFurnaceProcess.Selected.Result,Furnace:drpFurnace.Selected.Result})

 

The dropdown menus have these written in Item:

Furnace Process:

Sort(Distinct('Furnace Back End List','Furnace Process'),Result)

Furnace:

Filter('Furnace Back End List', 'Furnace Process' = drpFurnaceProcess.Selected.Result)

 

I've been following this tutorial (https://www.youtube.com/watch?v=Qzpjq008cBY&ab_channel=RezaDorrani) but I've gotten stuck on this part. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@charizard ,

That was the missing piece of information (they are Choice fields)

Patch(
   'FST,
   Defaults('FST'),
   {
      'Furnace Process': {Value: drpFurnaceProcess.Selected.Result},
      Furnace: {Value: drpFurnace.Selected.Furnace}
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @charizard ,

This item

Furnace: drpFurnace.Selected.Result

will not be .Result - it will be the name of the field you are displaying from the other list. So it that field was Furnace, the line would be

Furnace: drpFurnace.Selected.Furnace

Type in drpFurnace.Selected. and see what comes up underneath

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi Warren,

I've tried drpFurnace.Selected.Furnace and it's still giving me the same error. I've tried removing that furnace line completely as well and it still says invalid patch. 

Hi @charizard ,

What is the name of the field you are displaying ? That is what is required. Please have a read of this blog of mine.

Furnace Process and Furnace are the names of the fields.

 

charizard_0-1653303469801.png

 

I have two sharepoint lists: FST and Furnace Back End List. Both lists have the Furnace Process and Furnace field. 

The Furnace Back End List uses text for the Furnace Process and Furnace field, the FST list has them as choices.

 

@charizard ,

Can we rewind here please - you need to get the valid output of the Combo Box (which is why I linked my blog). This is a fundamental you will have to learn very early in your journey.

What is the ???? in drpFurnace.Selected.????. That is the value you need and can also be obtained by typing into code drpFurnace,Selected. (note second dot) and it will come up underneath. Also what type of fields are 'Furnace Process' and Furnace ?

The ???? in drpFurnace.Selected.???? is Furnace. Furnace Process and Furnace are both text type fields in my back end list (Furnace Back End list) but they are choice fields in my front end list (FST). 

@charizard ,

That was the missing piece of information (they are Choice fields)

Patch(
   'FST,
   Defaults('FST'),
   {
      'Furnace Process': {Value: drpFurnaceProcess.Selected.Result},
      Furnace: {Value: drpFurnace.Selected.Furnace}
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

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.

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 (3,224)