cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Continued Contributor
Continued Contributor

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
Highlighted
Continued Contributor
Continued Contributor

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

Highlighted

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)).

Highlighted
Continued Contributor
Continued Contributor

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,033)