web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help Needed with Patch...
Power Apps
Answered

Help Needed with Patch function

(0) ShareShare
ReportReport
Posted on by 1,151

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 

Categories:
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @gazzo1967 

     

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

  • RezaDorrani Profile Picture
    12,145 on at

    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

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    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"

  • gazzo1967 Profile Picture
    1,151 on at

    @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

  • gazzo1967 Profile Picture
    1,151 on at

    @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

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    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

     

  • gazzo1967 Profile Picture
    1,151 on at

    @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

  • gazzo1967 Profile Picture
    1,151 on at

    Thanks again 🙂

    Works perfect

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard