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 Apps
Unanswered

Patching error

(0) ShareShare
ReportReport
Posted on by 45

Hi,

 

I have an error popping up when I try to patch an excel sheet. Here is the code.

Patch(
Table2,
{
Name: Text_Name.Text,
Place: Place.Text,
Number: Dropdown_Num.Selected.Result,
Code: ComboBox_Code.Selected.Code,
StDate:TextInput_DSTT,
StTime:TextInput_TSTT,
EdDate:TextInput_DETT,
EdTime:TextInput_TETT
}
)

The errors I get are:

Screenshot 2021-05-20 074109.jpg

 

The StDate Column in my excel sheet is formatted to a 'Date' format and I'm wondering if that is affecting it. I need it to show a date format in the excel sheet and not some general text. I've also tried; .text, .format(date()), .selected.value. 


Any ideas? Thanks for looking

Categories:
I have the same question (0)
  • C-Papa Profile Picture
    1,836 on at

    Hi, try converting the text date string to a date, as an example, in the patch, change TextInput_DSTT to  DateValue(TextInput_DSTT), you will need to do similar for all dates. 

  • WeAllStardust Profile Picture
    45 on at

    I tried that and it gave me an error.

    Screenshot 2021-05-20 080853.jpg

    I added a '.Text' after TextInput_DSTT and it removed the error but the output showed as '2021-05-20T05:00:00.000Z' which is a weird format. I'm looking for '5/20/2021' format.

  • C-Papa Profile Picture
    1,836 on at

    ok, maybe try, Text(TextInput_DSTT,"dd/mm/yyyy"), you might have to change "dd/mm/yyyy" to match your column format in excel.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WeAllStardust 

    You need to account for the proper datatypes for your columns.  Your StDate appears to want a date/time value.

    Also, you are referencing the controls...not the control values.  You need to specify the property that has the value you want.   Assuming all of your controls are text controls, you need to reference the .Text property.

     

    Please consider changing your Formula to the following:

    Patch(Table2, 
     {
     Name: Text_Name.Text,
     Place: Place.Text,
     Number: Dropdown_Num.Selected.Result,
     Code: ComboBox_Code.Selected.Code,
     StDate: DateValue(TextInput_DSTT.Text),
     StTime: TimeValue(TextInput_TSTT.Text),
     EdDate: DateValue(TextInput_DETT.Text),
     EdTime: TimeValue(TextInput_TETT.Text)
     }
    )

     

    I hope this is helpful for you.

  • WeAllStardust Profile Picture
    45 on at

    I get the same error again

    Screenshot 2021-05-20 082203.jpg

  • WeAllStardust Profile Picture
    45 on at

    When I use that I get the 'Invalid Argument Type' control error. When I added the '.Text', it gave me a weird format that I didnt want. See my reply above. 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WeAllStardust 

    Have you used the formula I provided for you?

  • WeAllStardust Profile Picture
    45 on at

    Yes I did. The error goes away but this is what I get on excel
    times.jpg

     

    I had this working one time when I used labels instead of a text input. The text input box is what giving me errors. 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WeAllStardust 

     

    What is the format for the cells in Excel for the dates?

    The value you are getting in Excel is accurate as it is a date, but the format of that would be governed by the cell format.

  • WeAllStardust Profile Picture
    45 on at

    Here are the snapshots from excel

    date1.jpg

     

     

     

     

    date2.jpg

     

     

     

     

     

    time1.jpg

     

     

     

     

     

    time2.jpg

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 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard