Accept Ownership of Items in SharePoint List Queue

Ownership of item in SharePoint Queue

A lot of the times, there is a need for a group of people to take ownership of tasks, action items, etc without the system automatically assigning it. Sort of how ticket management system work. In SharePoint, the problem is, unless you are in quick edit(not user friendly), you have to click into the form and change the people picker field. This for a lot of my clients is one too many clicks. The easier way is through JSON Formatting on the new SharePoint modern view.

The end result is the below. A button users can click from the list grid view and have automatically update the Owner field, the status field, and maybe kick of a workflow process as well!

What we are essentially doing is running a flow when that button is clicked and prompting a people picker column to be filled in. This will run the flow and update the Owner field as well as the status field and you can add whatever other process to it like sending an email, changing permissions, etc.

First create a Boolean column in SharePoint(Yes/No), you can name it whatever you want. I will call it 'Accept'. Next create a choice column for status(Not Started, In Progress, Completed) and a people picker column for owner.

Click on the (Yes/No) column, click edit column, and under format this column, insert the following JSON below.

{
'$schema': 'https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json',
'elmType': 'span',
'style': {
'color': '#0078d7'
},
'children': [
{
'elmType': 'span',
'attributes': {
'iconName': ''
}
},
{
'elmType': 'button',
'style': {
'border': 'none',
'background-color': 'transparent',
'color': 'Black',
'cursor': 'pointer',
'visibility': {
'operator': '?',
'operands': [
{
'operator': '==',
'operands': [
'[$Status]',
'Not Started'
]
},
'visible',
'hidden'
]
}
},
'txtContent': 'Accept Ownership',
'customRowAction': {
'action': 'executeFlow',
'actionParams': '{'id': '9787e014-9f98-4815-8a76-a63023716a73'}'
}
}
]
}

The JSON formatting code above needs to be changed in a few places. First, the last part with the GUID needs to be replaced with your flow that you create. This can be found by going to your flows. Click on the flow, and on the top you should see a GUID after /flows/.  Copy that to the end.

Change the 'txtContent' to whatever you want the button to say.

Last I have a condition to hide the 'Accept Ownership' button if the status is not 'Not Started'.

That's it!




Leave a Reply

Your email address will not be published.


Comment


Name

Email

Url