cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yserrano
Regular Visitor

Error patch by File blocked

How I can't handle the File Locked error to send a message on the screen.

 

My Code is:

 

UpdateContext(
{
BotonMsg: IsError(
Patch(Datos;{Campo1:TextInput1.Text; Campo2:TextInput2.Text;Imagen:Image1.Image})
)
}
)

 

But in the code the variable returns a "False" and the file did not register the information, because it is blocked.
 
Help me please, Thank you
 
 

 

3 REPLIES 3
RandyHayes
Super User
Super User

@yserrano 

Is your datasource an Excel file?  If so, it needs to be closed in Excel before you can use it.

Close the file and try your app again.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Deard @RandyHayes,

Thank you by the support. But I need to control this error because I want display a message to the screen, which tells me when there are a problems...

 

Example:

iferror(patch(..,{}), true, false)

 

But this instruction do not returns a error, when I see the file is blocked.

 

Thank you

 

@yserrano 

There is not a lot of error handling in PowerApps.  If you are dealing with an Excel file, it is assumed that it is closed and available to PowerApps.

You can attempt to use IfError(patch(...), false, true) to catch the error, but it will still notify users and cause a warning banner.  You could then use the ErrorInfo object to get more detail on the error, but there is not much more beyond that.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,500)