Skip to main content

Notifications

Power Automate - Using Flows
Answered

Help with Filter Array for Delete items

(0) ShareShare
ReportReport
Posted on by 4,537

I am trying to test a comparison for a Delete item flow using a filter array. I don't believe it is working properly, as I am not getting the results I think I should be getting.

My assumption is the array return should only include Jack Frost, Mary Appleton, Merv Gruper, Sammy Hammer - from the Test Data Transfer List, as they don't appear on the MWEmployeeList.

But my results are not showing my assumption, rather all the names from the MWEmployeeList.

Phineas_1-1685474061078.png

 

Phineas_2-1685474134946.png


Apply to each Value ('Get items' Employee_List body/value)
Filter Array Value ('Get items2' Transfer_List body/value)
FullName (item()?['FullName'] is not equal to FullName items ('Apply to each') ?['Title'] (which is FullName)

Phineas_0-1685474000318.png

Phineas_3-1685474745011.png

 

  • Phineas Profile Picture
    Phineas 4,537 on at
    Re: Help with Filter Array for Delete items

    Back to this 'Create items' component; I have pre-existing data in SPList2, where the new items are to be created.

    I don't want those 'existing' items overwritten or changed as a result of the 'Create items'.

    How do I create the new items where there are existing items?

    Am I correct in assuming I need a Condition that compares the Output of Select1 to Select2, and where Select1 doesn't exist create the item in SPList2? This will leave existing as is and ONLY create new items?

    Phineas_2-1685633589426.png

     

  • Phineas Profile Picture
    Phineas 4,537 on at
    Re: Help with Filter Array for Delete items

    Content removed.

  • Phineas Profile Picture
    Phineas 4,537 on at
    Re: Help with Filter Array for Delete items

    My portion and my flow are not with the Excel file.

    I'm working with the SPList.

    There are currently 602 items in the source SPList1 and 582 in the destination SPList2.

    One of the columns in the source SPList1 that has blanks is 'Title'.

    I put - Title ne '' in the filter query of the Get items (the source data). Should this eliminate the blanks? 

  • wskinnermctc Profile Picture
    wskinnermctc 6,512 on at
    Re: Help with Filter Array for Delete items

    You need to type in the column name and that it is not equal to '' (two single ' quotes that identify no text)

     

    Type this below in your filter and replace the column name. If your column name has spaces or special characters, it probably won't work properly.

     

    ColumnName ne ''

     

    ExcelExcel

  • Phineas Profile Picture
    Phineas 4,537 on at
    Re: Help with Filter Array for Delete items

    Ok.

    Building it right now.

    Question; How do I filter OUT all blanks coming in from the Get items and Get items 2?

    The data source flow (source is and Excel workbook with a Table, created by someone else) has a Table range of A:O rather that A1:O (whatever the line number - around 650), and is creating hundreds of blanks lines in my SPList2 that I don't want or need.

    Can I build and expression in the Get items filter query that will eliminate these blanks?

  • wskinnermctc Profile Picture
    wskinnermctc 6,512 on at
    Re: Help with Filter Array for Delete items

    It is basically the same process except opposite when it comes to the Select and Filter Array. I've added the steps to the previous flow.

     

    Add New ItemsAdd New Items

  • Phineas Profile Picture
    Phineas 4,537 on at
    Re: Help with Filter Array for Delete items

    Great.

    Now my source data (SPList1) has 604 items and my updated data (SPLIst2) has 582 items.

    This means the delete worked, however there are new items in SPList1 that need to be added to SPList2.

    How and where do I add a 'Create item' to account for and make copies of the new items from SPList1 to SPList2?

  • Verified answer
    wskinnermctc Profile Picture
    wskinnermctc 6,512 on at
    Re: Help with Filter Array for Delete items

    Here are the steps that will delete the items from your Test List.

     

    SP Filter Delete Items Not MatchedSP Filter Delete Items Not Matched

     

  • Phineas Profile Picture
    Phineas 4,537 on at
    Re: Help with Filter Array for Delete items

    I want to delete items from the Test List. the MWEmployee is the source data. If the name is not on MWEmployee delete it from Test List.

  • wskinnermctc Profile Picture
    wskinnermctc 6,512 on at
    Re: Help with Filter Array for Delete items

    The flow doesn't make sense to me with the Apply to Each and then a Filter Array.

     

    You are saying For Each item in the Employee List, I want to Filter the Transfer List to show all items that do not equal the item name from Employee List.


    So the first Apply to Each will be using "Curtis T", and the Filter Array will have all of the Transfer List names that do not equal "Curtis T".

     

    The second Apply to Each will be using "Bo Regard", and the Filter Array will have all of the Transfer List names that do not equal "Bo Regard". (It will still include "Curtis T" because that filter array is on the previous loop.) The only name that will be filtered out is "Bo Regard".

     

    The third Apply to Each will be using "Julie DeLaw", and the Filter Array will have all of the Transfer List names that do not equal "Julie DeLaw". (It will still include "Curtis T" and "Bo Regard" because those filter array is on the previous loop.) The only name that will be missing is "Julie DeLaw".

     

    Each Apply to Each loop is it's own flow. The filter array doesn't carry over actions from the previous Apply to Each.

     

    Which list are you trying to Delete items from? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard

Featured topics

Restore a deleted flow