Share via

Complex Flow to Auto Complete Task Items Not working

Anonymous
2019-12-24T14:24:25+00:00

I have a flow that I can’t get to cooperate. I have only been building flows for a few weeks. This is only my 4^th^ flow.

Here’s what I’m trying to do:

I have a list (Tasks) used to sync with Project. Tasks has the following columns:

Each Tasks list (Task List content type) has 2,000 to 5,000 items. Users report completion against about 60% of the items, but we would like to complete the rest of the items automatically based on completion of dependent items. The items users report directly against are denoted by “Yes” in the “WR Flag” column. The items not reported against have “No” in that column.

When an item in the table is updated, the flow is triggered and does the following:

(1) Set some variables for later processing

(2) Check to see if the modified item is now complete

a.       If Yes,

i.      Get items filtered by

1.       NWR Flag is “No”

2.       % Complete < 1

3.       The modified item is a predecessor

Expression: and(less(body('Get_Tasks_items')?['PercentComplete'],1),equals(body('Get_Tasks_items')?['WR_x0020_Flag'],'0'),contains(body('Get_Tasks_items')?['Predecessors'],triggerBody()?['ID']))

·         NOTE: I tried to filter in the same get items statement, but got an error saying that the ‘get items’ couldn’t refer to itself

·         I am also worried that even if I get this to work, the contains statement will bring back erroneous results (e.g. when modified item is ID ‘1’, it will return records where the predecessor ID is ‘16’ or ‘3416’, etc.)

                                                               ii.      Update some variables for use in updating items(s)

Input % complete expression: items(Apply_to_each')?['PercentComplete']

# Predecessors expression: length(body('Get_Non-Complete_Tasks_items')?['Predecessors'])

**Output % complete expression:**add(variables('Input percent Complete'),div(1,variables('# of Predecessors')))

·         My worry is that % complete won’t be calculated correctly if an item is modified again after it is already complete since I have no way of triggering the flow selectively and don’t know how to set a condition to check if the modification to the item is marking it complete for the first time.

  • I thought about creating another array column to hold the ‘ID’ of the completed predecessors and then updating it with the current modified ID so I can include it in the condition, but I’m not sure if that will work.

iii.      Update item(s)

ID expression: items(Apply_to_each')?['ID']

**Task Name expression:**items(Apply_to_each')?['Title']

b.       If No, stop processing.

My error is in the Apply to each 2 Step

Any help on this is greatly appreciated!

[PII is masked by Dihao Guo MSFT Support]

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2019-12-24T14:55:39+00:00

    Hi mentioch,

    Thank you for posting your question and sharing all detail information with screenshots here. From your description, you are trying to create auto complete task process on a SharePoint list by using Microsoft Automate (Microsoft Flow).  All the tasks in the SharePoint list are created from Microsoft Project. You would like to make the task process to complete automatically based on completion of dependent items. I understand that it would be more convenient, if it can be done automatically till the end of the processes. Because this flow process needs more coding skills. In this scenario, I would like to  recommend you raise this question in Microsoft Automate Community (Microsoft Flow) seek for professional suggestions on this question. I believe a lot of experts of Microsoft Automate can provide more professional recommendations or ideas on this question. Sorry for the inconvenience caused. Appreciate your understanding.

    Wish you have a nice holiday. Merry Christmas  :)

    Best regards,

    Dihao

    Was this answer helpful?

    0 comments No comments