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, Defaults, then ...
Power Apps
Answered

Patch, Defaults, then Reset

(0) ShareShare
ReportReport
Posted on by 438

I have issue with Patch, Defaults, then Reset... How has it come to fix and correctly?

 

Patch(
'PBiS Transaction History',
Defaults('PBiS Transaction History'),
{
'L-Grade': 'Dropdown1_1'.SelectedText,
'Full Name': 'Dropdown1'.SelectedText,
'D/W': 'Dropdown1_2'.SelectedText,
'D-Tickets': 'TextInput2_1'.Text,
'Comment': 'TextInput2'.Text,
'Submitted By': User().FullName
}
);Reset(Dropdown1_1)&Reset(Dropdown1)&Reset(Dropdown1_2)&Reset(TextInput2_1)&Reset(TextInput2)

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @dylandavis09 ,

    You have not said what the issue/error is (although the resets are better as below).

    Patch(
     'PBiS Transaction History',
     Defaults('PBiS Transaction History'),
     {
     'L-Grade': 'Dropdown1_1'.SelectedText,
     'Full Name': 'Dropdown1'.SelectedText,
     'D/W': 'Dropdown1_2'.SelectedText,
     'D-Tickets': 'TextInput2_1'.Text,
     'Comment': 'TextInput2'.Text,
     'Submitted By': User().FullName
     }
    );
    Reset(Dropdown1_1);
    Reset(Dropdown1);
    Reset(Dropdown1_2);
    Reset(TextInput2_1);
    Reset(TextInput2)

    What type of fields are 'L-Grade''Full Name' and 'D/W' ?

     

  • Ali_Sheraz_77 Profile Picture
    141 on at

    Hi,
    [

    you are using text  with dropdown.selected.Text instead of value

    try this code 

     

    Patch( 'PBiS Transaction History', Defaults('PBiS Transaction History'), 
    { 'L-Grade': Dropdown1_1.Selected.Value, 
    'Full Name': Dropdown1.Selected.Value, 
    'D/W': Dropdown1_2.Selected.Value, 
    'D-Tickets': TextInput2_1.Text, 
    'Comment': TextInput2.Text, 
    'Submitted By': User().FullName } ); 
    Reset(Dropdown1_1); Reset(Dropdown1); Reset(Dropdown1_2); Reset(TextInput2_1); Reset(TextInput2);

     

    ]

    Please give a thumbs up if this information is helpful.

    Best regards,
    Ali Sheraz

  • dylandavis09 Profile Picture
    438 on at

    @WarrenBelz, 'L-Grade' is value, 'Full Name' is text, and 'D/W' is value.

     

    Screenshot 2023-11-05 153802.png

  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @dylandavis09 ,

    By Value I assume you mean a Choice field - I also should have asked for the Items of those drop-downs as an output of .Value (which I have used below) may not be correct.

    Patch(
     'PBiS Transaction History',
     Defaults('PBiS Transaction History'),
     {
     'L-Grade': {Value: 'Dropdown1_1'.Selected.Value},
     'Full Name': 'Dropdown1'.Selected.Value,
     'D/W': {Value: 'Dropdown1_2'.Selected.Value}
     'D-Tickets': 'TextInput2_1'.Text,
     'Comment': 'TextInput2'.Text,
     'Submitted By': User().FullName
     }
    );
    Reset(Dropdown1_1);
    Reset(Dropdown1);
    Reset(Dropdown1_2);
    Reset(TextInput2_1);
    Reset(TextInput2)

     

    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

     

  • dylandavis09 Profile Picture
    438 on at

    Here, screenshot.

    Screenshot 2023-11-05 160326.pngScreenshot 2023-11-05 160400.png

  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    @dylandavis09 ,

    Not sure what I can see there other than no errors

  • timl Profile Picture
    36,785 Super User 2026 Season 1 on at

    @dylandavis09 

    Your D-Tickets is a number column - therefore converting the text input control to a number by calling the Value function may solve the error.  Otherwise, if you post the error that appears when you hover the mouse over the red exclaimation mark, we can maybe help you further.

     

    Patch(
     'PBiS Transaction History',
     Defaults('PBiS Transaction History'),
     {
     'L-Grade': {Value: Dropdown1_1.Selected.Value},
     'Full Name': Dropdown1.Selected.Value,
     'D/W': {Value: Dropdown1_2.Selected.Value}
     'D-Tickets': Value(TextInput2_1.Text),
     'Comment': TextInput2.Text,
     'Submitted By': User().FullName
     }
    );
    Reset(Dropdown1_1);
    Reset(Dropdown1);
    Reset(Dropdown1_2);
    Reset(TextInput2_1);
    Reset(TextInput2)

     

  • dylandavis09 Profile Picture
    438 on at

    @WarrenBelz, look at screenshot and they show error message: (see below)

     

    Screenshot 2023-11-05 214135.png

    Error Message: "The type of this argument 'D_x002d_Tickets' does not match the expected type 'Number'. Found type 'Text'."

     

  • Verified answer
    WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    @dylandavis09 ,

    Yes - you did not show the error before and @timl picked the issue up from the field definition (which I initially missed)

    Patch(
     'PBiS Transaction History',
     Defaults('PBiS Transaction History'),
     {
     'L-Grade': {Value: 'Dropdown1_1'.Selected.Value},
     'Full Name': 'Dropdown1'.Selected.Value,
     'D/W': {Value: 'Dropdown1_2'.Selected.Value},
     'D-Tickets': Value('TextInput2_1'.Text),
     'Comment': 'TextInput2'.Text,
     'Submitted By': User().FullName
     }
    );
    Reset(Dropdown1_1);
    Reset(Dropdown1);
    Reset(Dropdown1_2);
    Reset(TextInput2_1);
    Reset(TextInput2)

    Your drop-downs also may not be correct depending on their Items

     

    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

  • dylandavis09 Profile Picture
    438 on at

    Oh okay, I just copy and paste. Now, it’s different error messages. See below. ⬇️

     

     

    Error Messages: Expected operator. We expect an operator such as +, *, or & at this point in the formula.

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard