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

@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

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (58,618)