cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mthiru
Level: Powered On

Attaching files/documents using Get file using path

Hello community,

 

The purpose of this flow to create a planner task when a message is created in conversations and to include or update the task with the attachments.

 

I am able to successfully create a task when a new message is created on the planner conversatons tab.  For example, i am using the planner connector "When a new channel message is added" and condition to identify the name of the message and "Create a task" planner task creation. 

 

Since planner conversations have their sharepoint document library, I wanted to see if I can update the task with "Get file metadata using path " and "Create sharing link for a file or folder". Currently the connection is broken at Get file metadate using path action.

Status is 404 error. I am not sure if i've configured this correctly. 

 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

You can get the contentUrl and name of the file contained in the attachment and add the attachment to the task details using the variable.

Image reference:

99.PNG

Details in Apply to each:

100.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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

20 REPLIES 20
Super User
Super User

Re: Attaching files/documents using Get file using path

Hi @mthiru 

Whilst this isn't a direct solution. You are using MS Teams and this uses email most of what you need and more is covered in here.

Might be worth a look - https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Create-Planner-Task-and-Include-At...

 

Maybe recreate this how to blog and see if you can transfer the techniques to your own project.

 

If you find my posts helpful, please mark with thumbs up

 

If this solves your issue, please click "Accept as Solution"

 

Any questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

Could you share a screenshot of the Flow configuration? Is the file you selected in the Get file metadata using path action fixed or dynamically changed?

 

The 404 error indicates that there is a problem with the configuration of the action. Please provide more details so that we can analyze the specific problem.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

Hi Alan,

 

Thanks for your post. I originally referred to your post to start our own flow. Only issue is that we have exchange on premises so the flow is not triggered from the receipt of an email.  What I did as a work around was create a rule in Outlook 2016 and associated the my planner email account to a emails which would create a conversation in planner. Once the item is created in planner this would create a task. What i want to be able to do is update the task with any attachments in the conversation if there are attachments in the conversation. As a planner usually has it Sharepoint Library, I thought I would be able to grab the reference document from the Sharepoint library and update the planner task. I am not sure how to do that.

 

I tried to follow your post from this point "Scope If Email Has Attachments Create Sharing Link”.

mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

Hi, 

 

 

 

Flow 1.PNGFlow 2.PNG

 

Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

You can get the contentUrl and name of the file contained in the attachment and add the attachment to the task details using the variable.

Image reference:

99.PNG

Details in Apply to each:

100.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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

mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

Hi Barry

 

Thanks for the post. I followed your directions and I have an error at the update task details level.  Error is :The request is invalid:\r\nInvalid JSON. The property name '' is not valid. The name of a property cannot be empty."

 

The flow creates the task but fails at stage 'updating the task with the attachment'. 

 

{
"error": {
"code": "",
"message": "The request is invalid:\r\nInvalid JSON. The property name '' is not valid. The name of a property cannot be empty.",
"innerError": {
"request-id": "8d6e6401-3e93-40c8-801b-5f9c7ee1ca4d",
"date": "2019-11-15T18:26:02"
}Flow 1.PNGFlow 2.PNG
}
}

Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

Can you share the details of your configuration? In particular, the Update task details action and the expression configured in the Append to array variable.

You didn't get the contentUrl correctly, so the value of resourceLink is null, which is not the expected parameter value to be configured.

Please follow the expression I provided, here is contentUrl instead of content.

115.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

Hi

 

Please see images of the whole flow configuration. 

In the append to array variable here is the following expressions used:

   Name : items('Apply_to_each')['name']

   ContentUrl: items('Apply_to_each')['contentUrl']

 

Within the update task details, expressions used:

Task id: body('Create_a_task')?['id']

Variables: ('References')

 

Flow 1.PNGFlow 2.PNG

Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

 

Please note that the configuration of the screenshots I provided, the Update task details action is configured outside of Apply to each, and is the last step.

 

Please check it.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

@v-bacao-msft 

 

 

 

Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

It seems that the contentUrl you get is empty, and the test results on my side are ok.

 

You can observe the body of the trigger and see if the value of the contentUrl under the attachment property is empty.

 

Best Regards,

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

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

Any updates?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

Hi @v-bacao-msft 

 

Thank you for following up. From your last message i thought this was hopeless and was considering other ways to update the task by referencing sharepoint document library. 

 

Any way i haven't had much progress. The flow errors out at the update task details level. I got an internal server error and status code 500.

 

Body from the Update task details:

 

{
"error": {
"code": 500,
"message": "Cannot set child value on Newtonsoft.Json.Linq.JValue.\r\n at Newtonsoft.Json.Linq.JToken.set_Item(Object key, JToken value)",
"source": "canada-001.azure-apim.net",
"path": "choose[9]\\when[1]\\choose\\when[1]",
"clientRequestId": "55048299-a6b5-4899-aebb-2569a541d0df"
}
}

 

Flow 1.PNG1stFlow 2.PNG2nd

Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

I haven't found out why this method doesn't work on your side. It looks like you can get contentUrl now, which is good progress.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ddelgado
Level: Powered On

Re: Attaching files/documents using Get file using path

Hi @mthiru,

 

I'm looking to do the same thing you are looking to do. How were you able to pass through the 'contentUrl' value? My Flow still fails at this point.

mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

hi @ddelgado 

 

No! I haven't figured it out. I am hoping Microsoft team will have aid us in this process.

please let me know if you learned of a workaround for this.

Community Support Team
Community Support Team

Re: Attaching files/documents using Get file using path

 

Hi @mthiru ,

 

Your screenshot shows that you have obtained contentUrl, and the value behind resourceLink is no longer empty.

Didn't you notice this?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mthiru
Level: Powered On

Re: Attaching files/documents using Get file using path

Hello @v-bacao-msft 

 

 

Yes, i see that it finds the content URL. I tested again and in this instance the resource link is null. "resource link: null"

See screen shot. 

 

Flow 1.PNG

ddelgado
Level: Powered On

Re: Attaching files/documents using Get file using path

I see. Did you do anything different for the Append to Array Variable step that allowed the contentUrl to be passed through? I am still stuck with a 'null' value at that point.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,449)