cancel
Showing results for 
Search instead for 
Did you mean: 

Flow > Planner - Assign a task to multiple people simultaneously

When creating a task in Planner, allow assigning to multiple people simultaneously.

 

(Currently, I have to action to create each task (assigned to one person), and then have an action to update the just-created task to add another assignee. If I wanted a third assignee, I'd have to create yet another update action)

Status: New
Comments
Kudo Collector

How do you get the UserId for those people?  I'm stuck there.

Advocate V

Hi ChrstnMchl -

 

Before your "Create Task" action, you have to have an action from "Office 365 Users" connector, "Get User Profile".  Put in the email of the person who's profile you want to get, and then their UserID is something available as an output from that.  I've included 2 screenshots below - the first one shows the "Get User Profile" action and the create task action.  The second screenshot shows the details of the "Create Task" action with the userID being filled in as dynamic content.


1st Screenshot:

 

2nd Screenshot:

Kudo Collector

Thank you so much!  I was looking in Teams and in Planner trying to find where it would be listed.  That fills in the blanks!

 

Does it keep the User until you do another look up?

 

Also, how are you getting your date Output?  Is there any formula to it?

 

Sorry to pick your brain so much - I have been trying to find these answers and feel like I keep dancing around them.

I have several projects that I need to put the same tasks and assignments in but with different dates.  I have a manual button that I can enter the Plan name in a text field and I have finally successfully set it up so that it the condition works to find that Plan and add the tasks.  I didn't have the name part figured out, still don't have the dates, and it all goes to the To Do bucket to be moved to the right bucket manually.  I'd love to have it go to the right bucket with the right person with the right due date.  Since I am using a variable for the Plan to get the Plan Id I do not have a list of buckets. I could probably use the same type of condition I am to find the plan to find the bucket though.

 

I feel close to brilliance here.  If only I didn't have a real job I am supposed to be doing when I am trying to figure this out...

Kudo Collector

Oh, the other thing I have trying to figure out is how to create a new Plan based on a new event added to a calendar, and then have it add buckets too.  I think that is further down the road though.

Advocate V

Yes, there is a formula for the date.  I have a text input on my manual trigger for the date, and then I have an action - Connector: Data Operations, Action: Compose.  The formula in my 'Compose' Action is:

@formatdatetime(triggerBody()['text'],'yyyy-MM-ddThh:mm:ssZ')

 

You can do multiple user lookups and use the results anytime later in the flow.  Screenshot below:

user_profiles.png

 

Since I'm only using one plan, I don't have the added issue of trying to use a variable for the Plan name, I just select the plan from the dropdown for "Plan ID" and then once I've selected that, I can use the "Bucket ID" dropdown to select which bucket within the plan.  There is a "List Buckets" action, and you may be able to use that to help what you want, but I haven't played around with it.

 

I'm also not sure if you can create a new plan dynamically with Flow.  I don't think that there's an action for that (or "Create Bucket") yet, but you can propose it here on Uservoice and maybe it'll get implemented.

Kudo Collector

Again - thanks!

 

Is the ['text'] just the text input from the button?  What format does that have to be in?  And can you write into the code to have it make the due date the day before that date?

 

I tried adding another condition within the condition to find the bucket but it said I couldn't have a For Each within a For Each or something like that.  I'm sure the logic is there somewhere but since it is such an easy thing to do manually I'm not going to chase that down further until later.

Advocate V

I have 4 text inputs on my trigger - Name, Due Date, Bob's Team?, and System Z Access?. (in that order).  The Due Date is the one that I'm formatting and using as the due date within Planner.  You could probably include a "minus one" calculation as part of the formatting.  Not sure what that'd look like.

 

Looking at the spots that I use the inputs - I don't do any computations on Name, but I use that as an output as part of the Task name when I'm creating tasks.

 

Due Date is ['text']

Bob's Team? is ['text_2']

System Z Access? is ['text_3']

 

For example, I have a condition to check on System Z access:

@or(contains(triggerBody()['text_3'], 'yes'), contains(triggerBody()['text_3'], 'YES'))

 

So, I'm guessing that Name would be ['text_0'], but I can't say that for sure.

 

What you could do for your bucket conundrum ... Create an action item to list buckets, and then create an action to send yourself an email. In the email, have the Bucket Name and Bucket ID ... then you can use that information to populate your bucket ID elsewhere in the flow, and get rid of the action to send yourself the email.  It's a kludgy workaround, but it could work.

Kudo Collector

Gotcha.  How do you enter the actual date in the prompt though?  Do you have enter it in the yyyy-MM-dd (etc) format for it to work?

Advocate V

In my testing, I've been using mm/dd/yy or mm/dd/yyyy.  I just tested with yyyy-mm-dd and that worked also.

 

BTW, I was wrong on the names of my inputs.  Name is ['text_1'] - I looked at a history, and looked at the details for the inputs.

 

{
  "type": "object",
  "required": [
    "text_1",
    "text",
    "text_2",
    "text_3"
  ],
  "properties": {
    "text_1": {
      "type": "string",
      "x-ms-dynamically-added": true,
      "description": "New User's Name",
      "x-ms-content-hint": "TEXT",
      "title": "Name"
    },
    "text": {
      "type": "string",
      "x-ms-dynamically-added": true,
      "description": "Date onboarding should be completed by",
      "x-ms-content-hint": "TEXT",
      "title": "Due Date"
    },
    "text_2": {
      "type": "string",
      "x-ms-dynamically-added": true,
      "description": "Is the user on Bob's Team? enter YES or NO only.",
      "x-ms-content-hint": "TEXT",
      "title": "Bob's Team?"
    },
    "text_3": {
      "type": "string",
      "x-ms-dynamically-added": true,
      "description": "Does this user require System Z Access? Enter YES or NO only.",
      "x-ms-content-hint": "TEXT",
      "title": "Z Access?"
    }
  }
}
Kudo Collector

Hrmm, I'm getting this error:

{"error":{"code":"","message":"The request is invalid:\r\nCannot convert the literal '@formatdatetime(triggerbody()@{triggerBody()['text_1']},'yyyy-MM-ddThh:mm:ssZ')' to the expected type 'Edm.DateTimeOffset'.","innerError":{"request-id":"39c5e6a8-825e-4a96-893d-328a152fdb3d","date":"2017-07-26T15:33:43"}}}