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

When an Item is Created or Modified...the most troublesome connector

It's me with my questions and stuff again...I'm at my wits end! I've used this trigger successfully, but it is not working and I'm not sure why.

 

First, here is my flow:

 

Screen Shot 2021-08-31 at 12.33.24 AM.png

 

When I check the flow, here is what is returned:

 

Screen Shot 2021-08-31 at 12.47.02 AM.png

 

When I add the item, I am including a value in the Title Column. The trigger fires, but all Has Column Changed items come back as False (which makes sense, I guess, since they haven't changed since the item was created).

 

How do I get the trigger to continue when the item is first created?

 

 

 

 

6 REPLIES 6
eric-cheng
Solution Sage
Solution Sage

Hi @garnern2 ,

 

Not sure if I am understanding this correctly.

 

When you use the 'get changes for an item or a file' action, the action only runs once and returns the changes within a snapshot of time i.e the window between Since and Until.

 

If you want to capture a running total of all your changes, you can specify the Since as the Created Date and just leave it at that.  Every time the item is created, it will trigger your flow again and get all the previous changes made. 

 

If you just want the most recent change, here is a link for further details.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

Thanks for the reply. I simply want my users to enter an Employee Number in Column one and it Insert the Employee's AD Profile Information in the relevant columns for that item. It's worked before, but I can't make it happen when we simply add the Employee Number.

Hi @garnern2 ,

 

Just to clarify:

 

1) User create a new list item and puts in their employee number e.g. 12345

2) Flow goes and gets AAD profile data and updates the same record with relevant details

 

You can achieve the above in a much simpler fashion.  The 'get changes for an item or a file' is usually used to retrieve previous versions of changes.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Yes, that's what I want to achieve...but the only relevant trigger I have used for this in the past is "When an Item is Created or Modified." Is there a trigger I'm missing?

eric-cheng
Solution Sage
Solution Sage

Hi @garnern2 ,

 

Yes, its possible BUT.

 

Do you need to have the users put in their employee number or can you just have a people field where employees select themselves?

 

Reason for this is there is a Get User action in the AAD connector but this takes their email. 

ericcheng_0-1630395476177.png

 

You may need to use Graph to search for the user otherwise.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

eric-cheng
Solution Sage
Solution Sage

Hi @garnern2 ,

 

Here's an example that should get you started.

 

1. Create a SP list with 3 columns.  Title is what I want to update with Display Name from AAD as an example.  People is what I will manually entering when creating the item and Pending is a Yes/No column which defaults to Yes.  This column is to prevent an infinite loop as you will have an 'Update Item' action will will continuously trigger your flow.  You can hide this column in SharePoint from your end users.

 

ericcheng_1-1630395612231.png

 

2) Use a When an item is created or modified trigger but add the below trigger condition.  This will ensure that the trigger will only run when Pending is true.

 

@equals(triggerBody()?['Pending'], true)

 

ericcheng_2-1630396512043.png

 

3) Use the Get User action (assuming you can pass the email), if you are passing employee number, try Graph.  Add an Update Item action.  Specify the ID from the trigger and your AAD attributes.  Remember to set Pending to No.

 

ericcheng_3-1630396690895.png

 

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Users online (2,053)