SOLVED

Can JSON formatting check if document is checked out?

Copper Contributor

In a SharePoint Document Library, I'm wondering if JSON formatting can check if a document is checked out. What I'm trying to do is change a value of a "Status" column to "under review" if the document is checked out. 

 

I tried to Google, use CoPilot, and bing to find an answer, but couldn't find a conclusive answer if it's even possible. 

 

Thank you for any guidance provided!

2 Replies
best response confirmed by Tyler_Borchardt (Copper Contributor)
Solution

@Tyler_Borchardt yes this is do-able. Make sure that in your view of the document library you are displaying the Checked Out To column (you need to go to Library settings to do this). That column has the internal name of CheckoutUser. Then format your status column with the following JSON:

 

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "div",
   "txtContent": "=if([$CheckoutUser]=='','','Under Review')"
}

 

 

CheckoutUser.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

@Rob_Elliott - Thank you, this is exactly what I was looking for!

1 best response

Accepted Solutions
best response confirmed by Tyler_Borchardt (Copper Contributor)
Solution

@Tyler_Borchardt yes this is do-able. Make sure that in your view of the document library you are displaying the Checked Out To column (you need to go to Library settings to do this). That column has the internal name of CheckoutUser. Then format your status column with the following JSON:

 

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "div",
   "txtContent": "=if([$CheckoutUser]=='','','Under Review')"
}

 

 

CheckoutUser.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

View solution in original post