cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikey04
Frequent Visitor

Errors function - Delete Icon

Using this formula to delete a record when using an Excel Table as a DataSource.  It works just fine.

 

Remove([@ExcelDataSource], Variable); If (IsEmpty(Errors([@ExcelDataSource], Variable)), Back())

 

Now I'm trying to use the same formula when a SharePoint List is the DataSource and I get an error.  Anyone know why?

I bolded where the error occurs.  The only difference is the DataSource in both my Apps.

 

Remove([@SPDataSource], Variable); If (IsEmpty(Errors([@SPDataSource], Variable)), Back())

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
ganeshsanap
Super User
Super User

Hi @mikey04, Can you please add some more details to your question? What is stored in Variable? What is the error message you are getting after using this formula?

 

As you know, You can use the Remove function to remove a specific record or records from a data source.

Syntax: 

 

Remove( DataSource, Record1 [, Record2, ... ] [, All ] )

 

ReferenceRemove and RemoveIf functions in Power Apps 

 

To check the error, you can use:

 

Errors( DataSource [, Record ] )

 

  • DataSource – Required. The data source for which you want to return errors.
  • Record – Optional. A specific record for which you want to return errors. If you don't specify this argument, the function returns errors for the entire data source.

ReferenceErrors function in Power Apps 

 

Try using below and see if it works for you:

 

Remove([@SPDataSource], Variable); If (IsEmpty(Errors([@SPDataSource])), Back())

 


Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it 👍

 

View solution in original post

3 REPLIES 3
ganeshsanap
Super User
Super User

Hi @mikey04, Can you please add some more details to your question? What is stored in Variable? What is the error message you are getting after using this formula?

 

As you know, You can use the Remove function to remove a specific record or records from a data source.

Syntax: 

 

Remove( DataSource, Record1 [, Record2, ... ] [, All ] )

 

ReferenceRemove and RemoveIf functions in Power Apps 

 

To check the error, you can use:

 

Errors( DataSource [, Record ] )

 

  • DataSource – Required. The data source for which you want to return errors.
  • Record – Optional. A specific record for which you want to return errors. If you don't specify this argument, the function returns errors for the entire data source.

ReferenceErrors function in Power Apps 

 

Try using below and see if it works for you:

 

Remove([@SPDataSource], Variable); If (IsEmpty(Errors([@SPDataSource])), Back())

 


Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it 👍

 

View solution in original post

Hi @ganeshsanap 

 

Thanks for the reply!

Removing the record and changing to your suggestion below did correct the issue.

Remove([@SPDataSource], Variable); If (IsEmpty(Errors([@SPDataSource])), Back())

 

The app I'm working with was a simple 3 screen app generated from a datasource and I just began editing from there.

I wanted more than one gallery tied to a Detail and Edit Form.  So on multiple galleries, I set the On Select properties of each gallery to a context Variable.   For Example:

Navigate DetailScreen1, {varTest1:ThisItem}).  I then set the Item of DetailForm1 and EditForm1 to varTest1.

The delete icon on the Detail Screen was pre-made and set to :

Remove([@SPDataSource], BrowseGallery1.Selected); If (IsEmpty(Errors([@DataSource], BrowseGallery1.Selected)), Back())

So I thought I could just insert the context variable in place of BrowseGallery1.Selected like this:

Remove([@SPDataSource], varTest1); If (IsEmpty(Errors([@DataSource], varTest1)), Back())

 

It worked fine when I was playing with Excel Tables as my DataSource, but when I started playing with SharePoint Lists... it did not and produced the error on Errors([DataSource], varTest1)).

@mikey04Great, I am glad it worked for you. Please ‌‌👍 and click Accept as solution on my above answer as it helped you to solve your issue. This will help others to find the correct solution easily. Also, it closes the question.

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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (59,331)