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?
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.
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?
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.
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.
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.
The trigger works on both Lists and Libraries, but assuming @ScottShearer is correct, then his approach will work. My bad.
Check out the News & Announcements to learn more.
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.