Skip to main content

Notifications

Power Automate - Building Flows
Answered

SQL View To Sharepoint List

(1) ShareShare
ReportReport
Posted on by 133
 I have the following flow which i need some assistance with.
 
I am pulling Employee Holiday data from a SQL View (which is joining 3 tables to give me the relevant date) i cant use the SQL Trigger for new item or update item as this doesnt work via On-Premise Gateway.
 
So currently the flow runs every hour Recurring Trigger, and picks up any new entries and populates these into a Sharepoint list... Sharepoint list has a column called sqlid & adsence_id is the primary key in the sql table.
 
My issue is, if a holiday request is deleted, or amended this creates a new absence_id, so i want to be able to delete the old absence_id which will no longer show in the SQL View, but is present in the Sharepoint Table...
 
Any advice much appreciated for best approach.
 
 
 
 
  • Verified answer
    FLMike Profile Picture
    FLMike 30,156 on at
    SQL View To Sharepoint List
    Hi
     
    I would
     
    1. Get your Items from SQL
    2. Use a Select to only grab the ID you want to verify exists in SharePoint
    3. Get your items from SharePoint
    4. loop through themn
    5. Do a filter on #2, the List of only ID's to see if your current Loop of the SharePoint list, has a matching one in the Unique SQL ID List
    If not then delete it
    if so ignore it
     
    The way you are doing it is backwards in your loop because the ones in the SQL Get Items should be in the LIst, or will be once you add it.
    But you want to verify if the LIst ID exists in the SQL.
     
    So, backwards for what you asked for.

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,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard