cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jayceeb
Helper III
Helper III

Delete row if the value is equals to zero

Hi, please help I want to delete a row using the difference between quantity and available item and if it's equals to zero I need to remove the item. I use this code but it still remain in the list.

Remove(Prod, If(qty-available=0, Gallery1.Selected)); 

I also use Remove(Prod,Gallery1.Selected);

however even if the row is not equals to zero the data will be deleted.

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User
9 REPLIES 9
AhmedSalih
Super User
Super User

Hello, @jayceeb, Try using RemoveIf function instead.

 

RemoveIf(Prod, qty-available=0);

 

 

If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


Visit my Blog: www.powerplatformplace.com


 

 

Drrickryp
Super User
Super User

jayceeb
Helper III
Helper III

I just try it but still the row not deleted 

 

jayceeb_0-1663521510921.png

 

Drrickryp
Super User
Super User

@jayceeb 

Are you sure that the column you indicated (qty-available) is the one containing the 0. It is shown as Total Qty in your table. 

@jayceeb, what you shared has the column Total Quantity. Use RemoveIf(Prod, qty-availableTotalQuantityColumnName=0);

jayceeb
Helper III
Helper III

I use the labels, instead of total qty column name however it still the same. 😞

patch update is no issue however when it comes in deleting the item with 0 values still remains 

RemoveIf(ProdCount, Counte_1-'Total Qty'=0);

 

Drrickryp
Super User
Super User

@jayceeb 

I am now confused about what the name of your data source is.  (ProdCount, Prod, Products)?  Whatever, do a collection of it

Collect(colprod,yourdatasource) and use the view>collections to see what the actual name of the column containing the 0 is.  _9.jpg

the datasource name is ProdCount and it's link in the excel file.

 

this is my complete code. only the the remove code is not working.


Patch(ProdCount,
Coalesce(LookUp(ProdCount,Date = df_2.Text&&'Product Name'=Itemselect_1.Selected.Result&& Menu=LookUp(ProdCount,'Product Name'=Itemselect_1.Selected.Result,Menu)&&Packaging=LookUp(ProdCount,'Product Name'=Itemselect_1.Selected.Result,Packaging)&&'Menu Code'=LookUp(ProdCount,'Product Name'=Itemselect_1.Selected.Result,'Menu Code')),
Defaults(ProdCount)),
Prodform_1.Updates);
ResetForm(Prodform_1);

 

RemoveIf(ProdCount,Counte_1-'Total Qty'= 0);

 

hi good morning. the name of my datasource is ProudCount and it's link in my excel in onedrive.

I'm using forms to update the new data. and if the value is equals to 0 i want it to remove automatically in my excel. It's like inventory that if you remove and add value.

 

Patch(ProdCount,
Coalesce(LookUp(ProdCount,Date = df_2.Text&&'Product Name'=Itemselect_1.Selected.Result&& Menu=LookUp(ProdCount,'Product Name'=Itemselect_1.Selected.Result,Menu)&&Packaging=LookUp(ProdCount,'Product Name'=Itemselect_1.Selected.Result,Packaging)&&'Menu Code'=LookUp(ProdCount,'Product Name'=Itemselect_1.Selected.Result,'Menu Code')),
Defaults(ProdCount)),
Prodform_1.Updates);
ResetForm(Prodform_1);

RemoveIf(ProdCount, Counte_1-'Total Qty'=0);

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,200)