cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Help Needed with Patch function

Hi all

I need some help from one of you super guru's here 🙂

Scenario

I have a power app that populates part one of the sharepoint list

This populates the Title and the other fields except 3.

Then i am using a second powerapp to populate the other 3 fields.

to do this i am using a gallery with patch function.

The Title field is a unique number which is used in the second app as the filter using a textinput to return the already populated fields with the other three fields as a combobox, a list and multiline textbox.

 

i know that i have to use the Title field so i am trying to use the filter input text box to Patch the Title and the other 3 fields but i just can't get it to work. If i write the formula it doesn't show any errors but as soon as i test it doesn't work and i can't figure it out!

 

Patch(TFF_PDP_Sign_Off,
Defaults(TFF_PDP_Sign_Off),
{
Title:tffsearch.Text,
QA_criteria:ListBox1.Selected,   (this is multi select should this be selecteditems?)
Approval_status:ComboBox5.Selected,
Approval_Rejection_Rationale:TextInput2
})

 

So what i am doing is using 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Help Needed with Patch function

Hi @gazzo1967 ,

Do you want to modify data, not create new data?

Firstly, since the data of Title field have been submitted, you need to use the formula about modifying, not creating.

Secondly, could you tell me the data type of  QA_criteria,Approval_status,Approval_Rejection_Rationale field?

                                             the items of ListBox1 and ComboBox5?

Since you use listbox and combo box, you also need to tell me whether QA_criteria,Approval_status is multiple selection.

I assume that:

QA_criteria and Approval_status is multiple choice, Approval_Rejection_Rationale is text.

Set ListBox1's Items: Choices(TFF_PDP_Sign_Off.QA_criteria)

Set the ComboBox5's Items: Choices(TFF_PDP_Sign_Off.Approval_status)

Set the submit button's OnSelect: 

Patch(TFF_PDP_Sign_Off,
LookUp(TFF_PDP_Sign_Off,Title=tffsearch.Text),
{
QA_criteria:ListBox1.SelectedItems,   
Approval_status:ComboBox5.SelectedItems,
Approval_Rejection_Rationale:TextInput2.Text
})

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Highlighted
Dual Super User II
Dual Super User II

Re: Help Needed with Patch function

Hi @gazzo1967 

 

You trying to add new item I assume and not update an existing item?

Highlighted
Dual Super User II
Dual Super User II

Re: Help Needed with Patch function

Hi @gazzo1967 

 

combobox patch example

https://powerusers.microsoft.com/t5/General-Discussion/Patch-issues-combobox/td-p/137617

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Super User II
Super User II

Re: Help Needed with Patch function

The "Defaults(TFF_PDP_Sign_Off)" in the second parameter means you want to create a new item with Patc and not update an existing item. To update an existing item the second parameter needs to be the record that is being updated. If the item is in the gallery and selected then you just need to use GalleryName.Selected as second parameter. 

 

I think yo uwill also need to change "QA_criteria:ListBox1.Selected" to "QA_criteria:ListBox1.SelectedItems"



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Post Prodigy
Post Prodigy

Re: Help Needed with Patch function

@Jeff_Thorpe 

That makes sense I Think

Title is populated but the other 3 fields are blank

How would i get ariund this?

You can put a form inside a gallery or can you lol

Regards Gary

Highlighted
Post Prodigy
Post Prodigy

Re: Help Needed with Patch function

@RezaDorrani 

As i have rsponded to @Jeff_Thorpe 

The Title field is being amended but the other fields are blank with now data as its being entered on the 2nd form

Regards Gary

Highlighted
Community Support
Community Support

Re: Help Needed with Patch function

Hi @gazzo1967 ,

Do you want to modify data, not create new data?

Firstly, since the data of Title field have been submitted, you need to use the formula about modifying, not creating.

Secondly, could you tell me the data type of  QA_criteria,Approval_status,Approval_Rejection_Rationale field?

                                             the items of ListBox1 and ComboBox5?

Since you use listbox and combo box, you also need to tell me whether QA_criteria,Approval_status is multiple selection.

I assume that:

QA_criteria and Approval_status is multiple choice, Approval_Rejection_Rationale is text.

Set ListBox1's Items: Choices(TFF_PDP_Sign_Off.QA_criteria)

Set the ComboBox5's Items: Choices(TFF_PDP_Sign_Off.Approval_status)

Set the submit button's OnSelect: 

Patch(TFF_PDP_Sign_Off,
LookUp(TFF_PDP_Sign_Off,Title=tffsearch.Text),
{
QA_criteria:ListBox1.SelectedItems,   
Approval_status:ComboBox5.SelectedItems,
Approval_Rejection_Rationale:TextInput2.Text
})

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Post Prodigy
Post Prodigy

Re: Help Needed with Patch function

@v-yutliu-msft 

Thanks for the response

 

You were correct other than i had to change

ComboBox5 is a single selection

I changed the formula to reflect this and it work perfect Smiley Very Happy

 

Never thought to use LookUp as i was trying to modify an existing entry and populate others that are blanl.

Im loving this!

Learn so much very quickly

Thank you

Highlighted
Post Prodigy
Post Prodigy

Re: Help Needed with Patch function

Thanks again 🙂

Works perfect

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (4,072)