cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
svanvalk
Level: Powered On

Send email with details if changes were made in SQL database over the last X hours?

I'm so stuck on creating this automation, I need some help.

I'm trying to create a scheduled flow for a daily tasks I have to perform manually. Every morning, I have to go into our SQL database table to determine if any new client contacts were added over the last 24 hours. If there was a modification to a contact for a client, whether a new one was added or if an existing one was changed, then I email our product team about the change. If there was no change, then I email them to say "There were no new contacts added yesterday".

 

I am unable to edit how the SQL table keeps it's data. When a new client contact is added, it modifies its value cell directly (rather than adding a new row for every change). Also, in order to get the formal business name, I need to get the data from another table in the same database (tbl_client_main). I wish I could change that too, but I only have read access to this SQL server.

 

Here is how my flow looks now. I'm stuck on how to continue from here, but I know I'm not extracting the data I need.

1.jpg

3.jpg2.jpg
4.jpg 

 

Would any of you know of any leads to help me figure out this logic? Anything would help me. Thank you!

2 REPLIES 2
Community Support Team
Community Support Team

Re: Send email with details if changes were made in SQL database over the last X hours?

 

Hi @svanvalk ,

 

First of all, we need to explain that we do not recommend adding two triggers in a Flow, which is not in line with the specifications.

Second, only one array type data source can be configured for selection in Select.

Third, the Output configured in the Header of the Create HTML table seems to be unreasonable. Here is the name of the field of the custom table, not the output of the Select.

 

If there are fields such as Modified time and Created time in this table to record change, then in Flow you can use the time to filter the rows.

 

Otherwise, you can only use When an item is created (V2) and When an item is modified (V2) as a trigger to create two Flows to monitor the changes of the table.

But the drawback is that Flow will fire whenever a new row is added to the table or the existing row is changed.

 

Hope it makes sense.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
svanvalk
Level: Powered On

Re: Send email with details if changes were made in SQL database over the last X hours?

Thanks for your breakdown! I've only created very simple flows before this, and I totally thought that this would be easier to tackle (famous last words lol). Unfortunately, there are no columns in the database that signify last modified time, so that's been quite the challenge.

 

Is there any control trigger that can work as "Check for changes made over X amount of time"? Or even, "When an item is modified, add to clipboard to keep track of change until destination time reaches in another flow"?

 

Is there any way to view what the output actually looks like? I was struggling with how to handle the outputs because I didn't know what the results were actually producing. In a trial of another program I had (which I'm no longer using due to it only being a trial), I created message boxes that showed the output result, so it helped me visualize what I was working with. Is there anything like that I'm accidentally skipping over?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,529)