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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Deleting SharePoint li...
Power Automate
Unanswered

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

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    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

    L

  • Vickylovesdiak Profile Picture
    7 on at

    D

  • Vickylovesdiak Profile Picture
    7 on at

    F

  • Community Power Platform Member Profile Picture
    on at

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard