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.
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.
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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,898)