cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevinsray
Helper IV
Helper IV

Automated Flow with SQL Query and Sharepoint files

Hi All,

I am really hoping someone can point me in a direction because I am lost.

What I have is a SQL table and a Sharepoint list (PICS) with lots of photographs.
The SQL table (SQT) looks like:
ID      P1      P2

1       False  False

2       True   False

3       True   True

 

Each of the photos in the PICS Sharepoint list has an ID value corresponding to the SQL table.

 

What I want to achieve is a scheduled flow that queries the sql table for IDs where P1 and P2 are both true.
Then finds any corresponding photos in the Sharepoint list and move them to a network share or separate Sharepoint list.

 

If anyone can give me some advice on how this can be done, it would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @kevinsray 

 

This is what you looking for. Here I have set my trigger as manual. You can use scheduled trigger. Then under the Get Items of SharePoint step (Third action step from top) you need to set the filter query where you can match the sql data to SharePoint. Once you had the match then under the iteration of apply each loop you can retrieve each item and copy or move to another list.

 

image.png

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

4 REPLIES 4
abm
Super User
Super User

Hi @kevinsray 

 

This is what you looking for. Here I have set my trigger as manual. You can use scheduled trigger. Then under the Get Items of SharePoint step (Third action step from top) you need to set the filter query where you can match the sql data to SharePoint. Once you had the match then under the iteration of apply each loop you can retrieve each item and copy or move to another list.

 

image.png

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

ABM,

Thank you so much.
This has gotten me a lot closer.

So, I got the SQL Get Rows working perfectly. I was able to confirm the data coming out what as expected.
However, I can`t seem to get it to work after that.

So, the SQL does it`s query and returns a list of BCIDs.

GetRows.jpg

The Get Items seems to want to go under it`s own Apply To Each

GetItems.jpg

And the Copy File goes to Apply To Each 2

CopyFile.jpg

 

It is very close. I can almost smell it.
What would I be doing wrong?

Hi @kevinsray 

 

What's the error you getting?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi ABM,

Sorry. I got it fixed.
I had the ID instead of the Identifier.
Now I have it working.
Thank you so much for your advice.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,908)