cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Spawn10
Helper II
Helper II

Question on how to use "When an item us created or modified" trigger

When using the "When an item us created or modified" is it necessary or possible to use a "Get changes for an item or a file (properties only)" action as well? My requirements are...

1. I want to send out an email when an item is created in the list.

2. If there an item is modified, to send another email. 

 

- So I am using the "When an item us created or modified" trigger.

- Should I also use the "Get changes for an item or a file (properties only)" action to detect when a change is made?

 

If I do need to use the "Get changes for an item or a file (properties only)" action, will a "Get item" action be required as well? So would it look something like this? 

 

Capture.PNG

 

6 REPLIES 6
Pstork1
Dual Super User III
Dual Super User III

The Get Changes for an item or a file will only work with the Modified trigger, not with the Created or Modified trigger.  If you think about it there can't be any changes to check against when an item is first created.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks @Pstork1 ,

Great point there. What would be the best way to determine if an item was just modified vs created? I want to send a different email when the item is modified. Would using the created and/or modified dates be a good approach?

ScottShearer
Super User III
Super User III

@Spawn10 

Assuming you have versioning turned on, check the version numbers to determine if an item has been modified or created.  If it isn't version 1.0, then it was modified.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Pstork1
Dual Super User III
Dual Super User III

The one exception to what @ScottShearer said is that if you have major and minor versioning enabled the first version may not be 1.0.  It could be 0.1 if minor versioning is enabled.  So I usually compare the Created and Modified date/time.  If they are within 5 minutes of each other you can assume the item was just created.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I agree with @Pstork1 however the scenario above uses a get item action indicating that this is for use with a list and not a library.  Lists only allow for major versions.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Pstork1
Dual Super User III
Dual Super User III

The trigger works on both Lists and Libraries, but assuming @ScottShearer is correct, then his approach will work.  My bad.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,271)