Forum Discussion
Lym_Wale
Jan 08, 2023Copper Contributor
Task List - Related Items Column
I have a document library and a task list in SharePoint. When a file is created on the document library, I need to create a task list item and set the value of 'related items' column to the file that...
SvenSieverding
Jan 08, 2023Bronze Contributor
Hi Lym_Wale
To add elements to the default "Related Items" column in a default SharePoint task list you need to uses the following REST endpoint
_api/SP.RelatedItemManager.AddSingleLinkToUrl
You can use it like this in PowerAutomate
POST _api/SP.RelatedItemManager.AddSingleLinkToUrl
Content-Type application/json;odata=verbose
{
"SourceListName":"Tasks",
"SourceItemID":1,
"TargetItemUrl":"/sites/classic/Shared Documents/Document.pdf",
"TryAddReverseLink":true
}
This call adds the file "/sites/classic/Shared Documents/Document.pdf" to the task with the ID 1 in the task list "Tasks" as a related item.
Best Regards,
Sven