web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Delete from second list

(0) ShareShare
ReportReport
Posted on by 82
I have two sharepoint lists that contain user information. This is a legacy and Im in the process of combining both lists, but I have many apps that are connected and untill I have the opportunity to redo all the various links, I need to ensure that if a user is deleted from one list, that same person is deleted from the second list. There is no common ID between the same user in the two lists, so I cannot use the ID field, but there are unique and cross-referencable name (title) values and unique cross-referencable email values in the tow lists that could be used to delete the user from the second list.
 
Any help with how to do this using the "When an item is deleted" trigger would be hugely appreciated.
 
Thanks in advance
I have the same question (0)
  • Suggested answer
    abm abm Profile Picture
    32,561 Most Valuable Professional on at
    Delete from second list
     
    Here it is
     
  • Paultys Profile Picture
    82 on at
    Delete from second list
    @Tom 01010100 thankfully "name" in my case is a suitable column to use as the user name is text in the Name/title column. 
     
    @abm abm thank you for your answer, my problem is creating the filter, I dont have the same boxes as you have displayed on the filter so Im nopt sure of the expression I need. 
     
    This is what I see in the classic designed view.
     
    and in the New Designer I see this...
     
     
     
    So Im not sure how to construct the Name = Equals part of the expression that is nicely nested in the boxes in your screen. Any suggestions?
  • MB-15091433-0 Profile Picture
    8 on at
    Delete from second list
    how did you get the Simplified Filter Query Editor in the Get Items Step?
  • Tomac Profile Picture
    2,059 Moderator on at
    Delete from second list
    @abm abm Looks like the "name" column is returned, but that's only helpful if the built-in "name" column is what @Paultys is using to store the data that can be cross referenced.
     
    For example, this is what was returned
     
    for a list that contained these fields
  • abm abm Profile Picture
    32,561 Most Valuable Professional on at
    Delete from second list
    Hi @Tomac
     
     
    Please see below. SharePoint does give the details not dataverse.
     
     
    Thanks
  • Suggested answer
    Tomac Profile Picture
    2,059 Moderator on at
    Delete from second list
    The "When an item is deleted" trigger doesn't give you the content of the item that was deleted, so you won't be able to achieve your goal this way.
     
    You'll need to, instead, implement a flow to delete the user that deletes them from both lists as the same time. This can either be manually run and query the user for who to delete, or can use the trigger "For a Selected Item" and is run from the list with a specific row selected.
     
    Corrected note: Note that in the below example from abm_abm, the body/name value is the built-in Name column from the list and is the only list data that's returned, so if you're not storing your like-data in the Name column that example will not work. This statement was corrected from a previous version that implied the body/name field contained the name of the person who deleted the row, which was incorrect.
  • Suggested answer
    abm abm Profile Picture
    32,561 Most Valuable Professional on at
    Delete from second list
    Hi
     
    Filter the second list using name or email which ever is unqiue.
     
     
    above I am using the name 
    triggerOutputs()?['body/Name']
     
     
     
    Finally delete items using the id form the filter above.
     
    Thanks
     
     
     
  • Suggested answer
    MB-15091433-0 Profile Picture
    8 on at
    Delete from second list
    Hey, 
    you should be able to just take the E-Mail of the user that is deleted from the list and then get the item from the other list the user is in.
     
    In the get items use: 
     
    Since the User is unique the Loop will only run once so no worries

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

Last 30 days Overall leaderboard