cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gavinleung
Resolver I
Resolver I

Update an list of Sharepoint item if a criterion is met

Hi all, 

I have a Sharepoint List with the following fields:

Table.png

 

 

 

 

 

 

The Regular Meeting happens nearly everyday, and all members will be joining. 

 

I'd like to setup a Flow that when anyone of the team members updated the Actual Hours of Regular Meeting of Today, then the other members' Actual Hours will be updated as of the value provided from the first one. 

 

I am trying with "When an item is created or modified", and successfully created a Condiition with:

formateDateTime(triggerBody()?['Assignment Date'], 'yyyy-MM-dd') is equal to formateDateTime(utcNow(), 'yyyy-MM-dd') 

AND

Title is equal to "Regular Meeting"

AND

triggerBody()?['Actual Hours'] > 0

 

But then, I am stuck to get the "Actual Hours" value to put it to the other members' records. Anyone can help? 

 

Thanks,

Gavin

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @gavinleung,

 

Please have a test with the following configuration:

Annotation 2019-09-03 154254.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

15 REPLIES 15
yashag2255
Dual Super User II
Dual Super User II

Hi @gavinleung 

 

Can you please share a screenshot of the flow configuration? Are you not getting the dynamic content for Actual Hours? Please share more details so that we may help you better.
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Here it is:

Flow cap.png

Hi @gavinleung,

 

What's the error message you have received?

Could you share the error screenshot about the update item Action, please?

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It's not an error. 

 

Based on the Condition, the flow proceeds if the conditions return true. Do I need to use Apply to Each with the conditions (as the condition above) and update the items acccordingly ? 

 

Gavin

Hi @gavinleung,

 

I make sense of your requirements. If the conditions return true, you should use Get items to get these items with the same Task, then add Apply to Each action to update the items get from Get items action.

For example:Annotation 2019-08-28 162205.png

Please have a try, I hope it can help you.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-litu-msft , so can the filter be a multiple criteria such as:

Title = "Regular Meeting"

Date = today

 

 

Hi @gavinleung,

 

Yes, it can, please have a reference to the following:

 

utcNow('MM-dd-yyyy')

 

reference#utcNow

To make sure the condition could be successful, you should make sure format of date is the same.Annotation 2019-08-28 173201.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-litu-msft , thanks for your advice and I revisited this. 

 

I'm having difficulty in filtering from the ListFlow cap.png

I wanna filter and update those records with a specific string AND the record with date today. 

 

My Filter Query: Title eq '@{triggerBody()?['Title']}' AND '@{formatDateTime(triggerBody()?['AssignmentDate'], 'yyyy-MM-dd')} eq '@{formatDateTime(utcNow(),'yyyy-MM-dd')}'

 

Do I miss anything? Or I am completely wrong? 

 

I couldnt find much documentation on this filter query. 

 

Thanks,
Gavin

Hi @gavinleung,

Please refer to the following multiple conditions Filter Query:

Annotation 2019-09-03 145819.png

 

column1 eq 'condition1' and column2 eq 'condtion2'

Please notice the and is "and", not "AND".

 

 

And your condition: Title eq '@{triggerBody()?['Title']}' AND '@{formatDateTime(triggerBody()?['AssignmentDate'], 'yyyy-MM-dd')} eq '@{formatDateTime(utcNow(),'yyyy-MM-dd')}'  have a addition single quota, please remove it. Then create the filter query:

Title eq '@{triggerBody()?['Title']}' and AssignmentDate eq 'utcNow('yyyy-MM-dd')'

Best Regards,

Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-litu-msft , I tried your but not successful. The flow failed to run...and no status showing at all:

Flow cap.png

I have no data where ran wrong. 

 

And btw my "AssignmentDate" field in Sharepoint List is a Date field with "9/3/2019" ('MM/dd/yyyy') format. Not sure if this is the issue causing an non-stop operation. 

Hi @v-litu-msft , can see the error message this time:

Flow cap.png

 

The error message is: "message":

"The expression \"Title eq 'Visual Management Meeting' and AssignmentDate eq 'utcNow('yyyy-MM-dd')'\" is not valid.\r\nclientRequestId: 8d1d9130-c07d-4b7d-86bb-12a5b0f94e02\r\nserviceRequestId: 8d1d9130-c07d-4b7d-86bb-12a5b0f94e02"

Hi @gavinleung,

 

Could you please share your Flow configuration?

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @gavinleung,

 

Please have a test with the following configuration:

Annotation 2019-09-03 154254.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks @v-litu-msft , it works ! And I have done what I wanna to do ! 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (81,575)