cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rmanthey
Level 8

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
rmanthey
Level 8

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
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.
rmanthey
Level 8

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,409)