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

What is the output of trigger "SharePoint - When an item is created or modified"

Hello,

 

I am trying to build a really simple flow, where when someone creates or modifies an item in my SP List I would send an email.
Here are my steps:

 

  1. I started from a blank template.
  2. Added a "SharePoint - When an item is created or modified" trigger. My site was not listed in the dropdown so I added a custom value in the format "https://xxx.sharepoint.com/sites/yyyy"
  3. Added a condition in order to check if the item is created or modified. So naturally I am expecting that the previous step would provide dynamic content relevant to item that got created or modifier. But what I get is a "List of Items"spListFlow.PNGIn advanced mode this dynamic content is translated to "triggerBody()"

This is really weird because I had previously done the same thing in another flow and the result of the step was the actual item and I could select its Properties.

The microsoft documentation is also obscure stating that for the operation GetOnUpdatedItems: "The outputs of this operation are dynamic"

https://docs.microsoft.com/en-US/connectors/sharepointonline/#when-an-item-is-created-or-modified

 

So my question is what to expect as a result from the trigger? Could it be possbile that since there is "quick edit" on sharepoint lists I might get a list of items, instead of one? Is it safe to go write triggerBody()['Title'] or access any other propery of the item? I was hoping to get the item's properties listed in the dynamic content but I was taken aback by the result.

 

Thank you

6 REPLIES 6
leyburn19
Level 10

Re: What is the output of trigger "SharePoint - When an item is created or modified"

Why dont you just do that on the settings to the List on SP itself under the built in "Alert Me"

 

Capture.PNG

pdrampis
Level: Powered On

Re: What is the output of trigger "SharePoint - When an item is created or modified"

Because I am intending to do much more than just sending an email. But am stuck at the first step.

leyburn19
Level 10

Re: What is the output of trigger "SharePoint - When an item is created or modified"

This wil triiger based on that criteria

SP Triggers.PNG

 

 

 

Super User
Super User

Re: What is the output of trigger "SharePoint - When an item is created or modified"

Most of the list item properties should be available to you in Dynamic Content when using the "When an item is crested or changed" trigger.

 

If you don't see what you want, check to see if there is a "more" link to the right of the "When an item is created or changed" heading in Dynamic properties.  If there is, click it to expose additional properties.

 

Also, you can compare the Created and Modified columns to determine if the trigger responded to a new item or a change to an item.

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

Scott
Community Support Team
Community Support Team

Re: What is the output of trigger "SharePoint - When an item is created or modified"

Hi @pdrampis,

 

I have made a test on my side and don't have the issue that you mentioned. The screenshot of my flow as below:15.JPG

Please take a try to clear cache of your browser and try your flow again to check if the issue is solved.

 

In addition, you could also access the properties of the item using the following formula:

triggerBody()?['PropertyName']

I assume that you want to reference the Created property and Modified property of the item, you could use the following formula:

Access Created property:

triggerBody()?['Created']

Access Modified property:

triggerBody()?['Modified']

I have made a test on my side and please take a try with the following workaround:16.JPG

Within Condition box, click "Edit in advanced mode", type the following formula:

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

The flow works successfully as below:17.JPG

 

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

 

Best regards,

Kris

 

 

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

Re: What is the output of trigger "SharePoint - When an item is created or modified"

@v-xida-msftthan you for the answer. I tried, cleaning my cache, I even used another browser but the dynamic content is still the same

 

Dynamic content

 

I haven't tried using the expressions you gave me.

But why am I seeing a different view from you? Could it be something with the list settings?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 68 members 3,694 guests
Please welcome our newest community members: