cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Anonymous
Not applicable

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
Super User II
Super User II

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,138)