Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

Delete row

Hello everyoone.

 

I want to create an action that will delete one row or (more) if i have two rows or (more) with the same column value and left just one.

Can someone help me to do this please? Thank you.

Solved Solved
0 7 436
1 ACCEPTED SOLUTION

You want to make sure there are no existing rows with the same ID_Equipment and Model. For this we will create a slice that contains only one row with the same unique pair. Let's name this slice uniquePairs

  • Create the uniquePairs slice with this row filter condition:

    [_RowNumber] = MIN(
      SELECT(Table[_RowNumber], AND(
        [ID_Equipment] = [_ThisRow].[ID_Equipment],
        [Model] = [_ThisRow].[model]
      ))
    )

Then you'll create an Action to delete all rows in your table that do not exist in the slice. This action will be configured as below:

  • For a record of this Table: yourTableName 
  • Data: Execute an action on a set of rows 
  • Referenced Table: yourTableName 
  • Referenced Rows: yourTableName[ID] - uniquePairs[ID] 
  • Referenced Action: Delete 

You can display this action as an overlay button that you can click to remove duplicates or make it as a Form Saved action so that it runs whenever the form is saved. 

A better approach, as @TeeSee1 said, is to prevent duplicates from happening in the first place. For this you can put the following expression in the Valid if  field of both your "Model" and "Equipment_ID" columns:

ISBLANK(
  FILTER(
yourTableName, AND(
    [ID_Equipment] = [_ThisRow].[ID_Equipment],
    [Model] = [_ThisRow].[model]
  ))
  - LIST([_ThisRow])
)
 

 

View solution in original post

7 REPLIES 7
Top Labels in this Space