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...
Ahmed_Masoud97
Jan 08, 2023Steel Contributor
HiiiiiLym_Wale,
Here is Ahmed, I'm a community visitor!
Let me try help you today:
To resolve the issue with the related items column not being populated in your task list, you can try the following steps:
Make sure that the file created in the document library has a unique identifier, such as a file name or file ID, that can be used to relate it to the task list item.
In the "Send an HTTP request to SharePoint" action, set the URI to the URL of the task list item that you want to update, and use the "PATCH" method. In the request body, include the following JSON:
{ "__metadata": { "type": "SP.Data.TasksListItem" }, "RelatedItemsId": { "results": [ "FILE_ID_OR_NAME" ] } }
Replace "FILE_ID_OR_NAME" with the unique identifier of the file in the document library.
- Save and run the flow again, and check the task list item to see if the related items column has been updated with the file from the document library.
If the above steps do not resolve the issue, you may want to check the permissions of the user who is running the flow to make sure that they have the necessary permissions to update the task list item. Additionally, you can try using the "Get item" action to retrieve the task list item before updating it, to verify that the item is being returned correctly.
If my solution was helpful, please mark this question as answered and consider giving it a thumbs up.
Your positive feedback motivates me to continue helping others.
Thank you for letting me be a part of your journey to finding a solution!
Ahmed