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
Answered

Deleting SharePoint list item/items if conditions met

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am new to using Power platforms and hoping someone can help. I am in the process of making a app in power apps to record absences/sickness & Leave request. The App feeds into 2 SharePoint Lists. Name of Lists and columns Detailed below:

 

(List 1)

  • Employee Number
  • Surname 
  • First name
  • Date of absence
  • Reason for Absence 

(List 2)

  • Employee Number
  • Surname 
  • First name
  • First day of absence
  • Last day of absence
  • Reason for Absence 

The issue I have is if a entry is added to the (List 2) I need a way for it to check to see if there is a matching Employee number in (List 1) if so, it would need to check if the date of absence in (List 1) falls on or between the First day of absence and the Last day of absence on (List 2). If this is the case I need it to delete that/those entries in (List 1). 

 

I hope this makes sense if you need any clarification on anything let me know.

 

Thanks

I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Deleting SharePoint list item/items if conditions met

    Hi @Anonymous ,

     

    I've made a test for your reference:


    1\List1:

    vbofengmsft_0-1696816863170.png

    2\List2:

    vbofengmsft_1-1696816933615.png

    3\My Flow

    vbofengmsft_2-1696817831902.png

    1)

    @and(
     and(
     equals(item()?['EmployeeNumber'], triggerOutputs()?['body/EmployeeNumber']),
     greaterOrEquals(item()?['Dateofabsence'], triggerOutputs()?['body/Firstdayofabsence'])),
     lessOrEquals(item()?['Dateofabsence'], triggerOutputs()?['body/Lastdayofabsence'])
     )
     

    2)

    items('Apply_to_each')?['ID']

     

    Best Regards,

    Bof

     

     

  • Vickylovesdiak Profile Picture
    7 on at
    Re: Deleting SharePoint list item/items if conditions met

    L

  • Vickylovesdiak Profile Picture
    7 on at
    Re: Deleting SharePoint list item/items if conditions met

    D

  • Vickylovesdiak Profile Picture
    7 on at
    Re: Deleting SharePoint list item/items if conditions met

    F

  • Community Power Platform Member Profile Picture
    on at
    Re: Deleting SharePoint list item/items if conditions met

    Hi 

     

    Thanks for the help i am  still a bit stuck when i am trying to put 

    items('Apply_to_each')?['ID']

     it is asking for a valid integer when i run a test

    Richardb87_0-1697529555133.png

     

    Thanks

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…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard