Forum Discussion

Tyler_Borchardt's avatar
Tyler_Borchardt
Brass Contributor
May 31, 2024
Solved

Can JSON formatting check if document is checked out?

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!

  • 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')"
    }

     

     

     

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

2 Replies

  • Rob_Elliott's avatar
    Rob_Elliott
    Silver Contributor

    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')"
    }

     

     

     

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

Resources