cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Patch Not writing to Excel on OneDrive

I have an Excel sheet on OneDrive that I wish to write some data to.  I know this isn't the preferred method for PowerApps but I just need to show how this would work then I plan on getting the Ok to move to Azure SQL for the back end.  

 

However, when I try to write the Batch_Number I get nothing and I am wondering if I must write data for every column in the table.  Right now I have this for the buttons OnSelect property:

Patch(Green_Data, Default(Green_Data), {Batch_Number: greenBatchLoadingBatchNumber.Text})

greenBatchLoadingBatch_Number is also a label that gets its value from a previous screen.  Should I change that to a textInput and disable it?

 

In Green_Data there are 20 columns(including the PowerApps Id column).  Does there need to be info for each column for it to write or what am I doing wrong.

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Patch Not writing to Excel on OneDrive

Hey Jeff, 

 

  Yea that was a typo on my end in that code block.  

 

I figured out what it was. 

When I created the Green_Data table in my excel sheet I had the Table size preset for 10000 rows (or records), all blank.  So my patch function was working, it was writing the Batch_Number on row 10001, outside of my defined table.  I figured this out by selecting that column and seeing Count: 12 in the bottom.  I thought how could there be 12 if nothing is showing up in A2.  So I scrolled all the way down and sure enough my 12 button clicks were all right there.  Now I need to fix all my other tables that I plan to write too.

 

Thanks for the quick repsonse,

Ryan

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Patch Not writing to Excel on OneDrive

I am not sure if this is just a typo but Default(Green_Data) should be Defaults(Green_Data). You don't need to update each field with the Patch, only the required fields.



--------------------------------------------------------------------------------
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
Anonymous
Not applicable

Re: Patch Not writing to Excel on OneDrive

Hey Jeff, 

 

  Yea that was a typo on my end in that code block.  

 

I figured out what it was. 

When I created the Green_Data table in my excel sheet I had the Table size preset for 10000 rows (or records), all blank.  So my patch function was working, it was writing the Batch_Number on row 10001, outside of my defined table.  I figured this out by selecting that column and seeing Count: 12 in the bottom.  I thought how could there be 12 if nothing is showing up in A2.  So I scrolled all the way down and sure enough my 12 button clicks were all right there.  Now I need to fix all my other tables that I plan to write too.

 

Thanks for the quick repsonse,

Ryan

View solution in original post

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,247)