cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

SharePoint Online List from SQL

Hi

 

I have a SharePoint list that is populated from SQL on a scheduled task.  I was to be able to use this list as a location where users can access to make requests to update data that then copies over to another SharePoint list for review by an SME.  The issue I'm having is the flow I'm using (When an Item is created or modified) is copying and emailing me everytime my SQL to SharePoint task runs.  I only want the data to copy and notify me when the data is modified by a user.  Any help as to how I can do this?

 

Thank you
Larry

10 REPLIES 10
Highlighted
Dual Super User III
Dual Super User III

Hi!

You probably need to add a 'Condition' action block, evaluate whatever condition you need, on the true branch add email notification, leave false branch empty

 

'notify me when the data is modified by a user'

A specific user, you mean?

On the left part of you condition you shall add the following expression

 

triggerBody()?['Editor']?['Email']

 

On the right side just type its email address

Operator: equals

 

Please note in order to add expressions you need to follow these steps

https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

 

Please implement suggested approach, if problem persis or flow execution fails please share a screenshot from Flow design

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted

Thank you @efialttes .  I will try this next week and let you know how it goes.

 

Larry

Highlighted

No problema
Have a good weekend! Please take care and stay healthy


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted

Hi @efialttes 

 

I went ahead and added the expression and(triggerBody()?['Modified'],not(equals(triggerbody()['Created']))) to both of the columns that I want.  When either of the two of these columns are modified (columns are choice), an email notification should be sent and the data with any attachments should be sent to my other list.  If the data is being replaced/created during the scheduled task from SQL, the notification email should not be sent and the data should not be copied.  

 

condition.JPG

 

 error.JPG

 

The users modifying this list is not just one person.  It could be anyone from my department.

 

Thank you

Larry

Highlighted

Wait, wait, wait... did my first suggestion worked?
Not with my laptop, sorry
Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted

The suggestion you made didn't fail but it didn't copy the data to my other list and it didn't send an email notification.   Below you will find the skip message I received.  

 

Capture.JPG

Highlighted

@larry_ourique 

"I went ahead and added the expression and(triggerBody()?['Modified'],not(equals(triggerbody()['Created']))) to both of the columns that I want.  When either of the two of these columns are modified (columns are choice), an email notification should be sent and the data with any attachments should be sent to my other list"

 

Probably it's me who is not understanding properly your approach... It sounds to me as a wrong one. First of all, 'Modified', 'Created' relates to the whole item, no to particular columns. So, if you create an item then modify any column value, Modified will no longer equal to Created.

 

Also the expression

 

 

and(triggerBody()?['Modified'],not(equals(triggerbody()['Created'])))

 

 

does not make sense. equals() needs two entries, you only added one

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#e...

 

Now, on the issue described at the beginning of this thread:

"I only want the data to copy and notify me when the data is modified by a user."

What I understood is that you wanted copy+notify when data is modified by a specific user (let's say bob@contoso.com). THat's why I suggested to evaluate a condition like:

 

 

equals(triggerBody()?['Editor']?['Email'],'bob@contoso.com')

 

 

When using a Condition action block, things are done in a more visual way, so you just add first entry on the left, either as an expression or by selecting it from Dynamic content

 

Then select operator equals

 

Finally add second entry on the right

 

 

bob@contoso.com

 

 

 

But, if your goal is to run this copy + notify when item is modified, then you should consider this alternate approach

 

 

 

not(equals(triggerBody()?['Created'],triggerBody()?['Modified']))

 

 

 

If you work with a Condition action block, then it should look the following:

Flow_CreatedModified.png

Please note my interface is in Spanish, but when I hover the mouse over the entry on the right, you can see triggerBody()?['Modified']. If I hover the mouse over the entry on the right, I would see triggerBody()?['Created']. Finally, operator selected ' is not equal to' corresponds to not(equals())

 

Hope this time I understood properly your requirements so all of this explanation makes sense



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper I
Helper I

thank you @efialttes for all this information and help.  I will try these steps later on this week (I am pretty tied up at the beginning of the week).  I will let you know if I have any better luck.

 

Thank you again for all your help.

Larry

Highlighted

Hi!

No worries, take your time.



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted

Hi @efialttes 

 

I had no luck with this.  I'm going to delete this flow (since it keeps running) and start a new one to see if I have better luck.

 

Thank you

Larry

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (7,871)