web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create new Task with D...
Power Automate
Unanswered

Create new Task with Document as a Related Item

(0) ShareShare
ReportReport
Posted on by 2

I have a sharepoint designer workflow that adds a task to a list when a document is added to a library, and makes the document a Related Item on the new list item. I have un-hidden the Related Items field from the Task content type. I add the field to both the library and the list, and when the document is added as a related item to the list item, SharePoint makes it a two way link.

I would like to try and use Flow to replicate this workflow. I need the Item ID, the GUID for the Web, and the GUID for the list. The format for a related item is:

{"ItemId":<id>,"WebId":"<guid here>","ListId":"<guid here>"}

...and the list of related items is contained in square brackets: [{related item 1},...,{related item N}]

 

So the question is, can I get the Web and List GUIDs in Flow, or do I have to create some function to find them and call that from the flow. There will be multiple sites containing this list so I would like to make the Flow as generic as possible.

Categories:
I have the same question (0)
  • danmitchell36 Profile Picture
    268 on at

    @Waryoldguy ,

     

    I created a very similar Flow to this. What you will need to do is create a hyperlink field on the task and add the url of the document, or the document library in that field. 

     

    One thing to note is that Flow does not support populating a hyperlink field with the create or update item actions so you will need to create or update the task field using a REST API. It is actually very easy to do and I wrote a blog post on what you need to do. Check it out below:

     

    https://www.dmcinfo.com/latest-thinking/blog/id/9832/creating-sharepoint-list-items-in-microsoft-flow-using-a-rest-api

     

     

    If this works for you please mark as the solution and give kudos!

    Thanks,

     

    Dan

  • Waryoldguy Profile Picture
    2 on at

    @danmitchell36 

    Thanks, this looks like the correct rabbit hole to go down, though my needs are slightly different. I will need to parse out what a related item looks like in JSON. I am sure that Flow cannot write that field directly either.

    Getting the webid is easy as it comes back as a single value. Any idea how to get the GUID of a library without all the other bits? Calling getbytitle() seems a bit dodgey with libraries, whereas it always seems to work with a list. It is also bringing a lot of baggage to get a single value.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard