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 / Patch function not acc...
Power Apps
Answered

Patch function not accepting .Default

(0) ShareShare
ReportReport
Posted on by 17

Hi all,

 

With very limited experience I'm trying to get belowmentioned patch function to work. Unfortunately, the formula would not accept .Default for my Owner_DataCard1-field coming from the form I'm pulling it from.

Can anyone see what I'm doing wrong here? As far as I can see (again, very limited experience) it should behave identical to the Identifier_DataCard1-field which is working fine.

 

Thanks a lot in advance!

 

 

 

Patch(CommentDataTable1,
 Defaults(CommentDataTable1),
 {Submitter: fetchFullName.Text, Comment: tb_Comment.Text, DocID: Identitfier_DataCard1.Default, DocOwner: Owner_DataCard1.Default}
)

 

 

 

Eric

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Eric18,

     

    You can reference the Selected Owner by referencing the combobox within that DataCard. That removed the error on my end.

    //Change to the correct owner combobox name
    DataCardValue.Selected

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • WarrenBelz Profile Picture
    155,291 Most Valuable Professional on at

    Hi @Eric18 ,

    Datacard.Default is not a valid Patch parameter - what value are you actually trying to Patch  - use the actual Default Value instead.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • developerAJ Profile Picture
    4,763 on at
    Patch(CommentDataTable1,
     Defaults(CommentDataTable1),
     {Submitter: fetchFullName.Text, Comment: tb_Comment.Text, DocID: Identitfier_DataCard1.Text, DocOwner: Owner_DataCard1.Selected}
    )

     

    Use this formula

  • Eric18 Profile Picture
    17 on at

    First of all, thanks for all your replies. Unfortunately though, for me changing what I had

     

    Patch(CommentDataTable1,
     Defaults(CommentDataTable1),
     {Submitter: fetchFullName.Text, Comment: tb_Comment.Text, DocID: Identitfier_DataCard1.Default, DocOwner: Owner_DataCard1.Default}
    )

    to

    Patch(CommentDataTable1,
     Defaults(CommentDataTable1),
     {Submitter: fetchFullName.Text, Comment: tb_Comment.Text, DocID: Identitfier_DataCard1.Default, DocOwner: Owner_DataCard1.Selected}
    )

    does not solve the problem.

     

    What I'm trying to do is to enable people to log a comment on a certain document on our sharepoint and write these comments to an Excel file. Therefore I made a connection to this sharepoint list and I pull the fields; Identifier and Owner. This together with the actual comment that users fill and the user's full name, I try to patch that to the beforementioned excel file on OneDrive.

     

    All these fields now patch correctly, except for Owner_DataCard1. I expected it to behave exactly the same as the Identifier one (I'm aware of the typo there which is in the sharepoint list), but the Owner one would not work with .Default. Also, .Selected would throw the same error.

     

    Hopefully I explained it sufficiently. Thanks a lot in advance again. 

    Eric

     

     

  • Verified answer
    developerAJ Profile Picture
    4,763 on at
    Patch(CommentDataTable1,
     Defaults(CommentDataTable1),
     {Submitter: fetchFullName.Text, Comment: tb_Comment.Text, DocID: Identitfier_DataCard1.Text, DocOwner: Owner_DataCard1.Selected.DisplayName}
    )

     

    try this or Select any field after ownerdatacard1.Selected. (similar to displayName)

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Eric18,

     

    Could you try referencing the Combobox within the Datacard. DataCardValue.Selected (change to the correct came).

     

    On my end, this fixed the error when using a column of type person.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Eric18 Profile Picture
    17 on at

    Thanks developerAJ and LaurensM,

     

    A mix of both your comments actually solved this for me. I'm very grateful!

     

    Eric

     

    Patch(CommentDataTable1,
     Defaults(CommentDataTable1),
     {Submitter: fetchFullName.Text, Comment: tb_Comment.Text, DocID: Identitfier_DataCard1.Default, DocOwner: DataCardValue3.Selected.DisplayName}
    )

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 644

#3
11manish Profile Picture

11manish 626

Last 30 days Overall leaderboard