cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Super User
Super User

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

Highlighted
Frequent Visitor

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.

Highlighted
Super User
Super User

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

 

 

 

Highlighted
Super User III
Super User III

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
Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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
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.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (4,778)