0

I'm trying to check the value of the column _ModerationStatus in a document library with that has content approval.

I have the following JSON:

 {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
      "elmType": "div",
      "debugMode": true,
      "txtContent": "[$_ModerationStatus]"
}

I get the following message in the console:

could not evaluate _ModerationStatus

The column is included in the view and the column displays Approved and so on. So the column seems to be working correctly.

What am I doing wrong? :)

  • 1
    Where is the column name _ModerationStatus? – Utkarsh Dubey Mar 27 '19 at 14:51
  • Hi, what do you mean? :) – Perka Mar 27 '19 at 15:05
  • 1
    In the following JSON which you mention on your query, where is the column name _ModerationStatus? – Utkarsh Dubey Mar 27 '19 at 15:07
  • Do you mean in the schema? – Perka Mar 27 '19 at 15:13
  • This question has already answer: stackoverflow.com/questions/5579077/… – Utkarsh Dubey Mar 27 '19 at 15:18
1

As a workaround, we can create a text field "ApprovalStatus", then create a workflow to set the value from the "Approval Status" field to this new field.

Then using the JSON below:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "debugMode": true,
  "txtContent": "[$ApprovalStatus]"
}
  • Yes, that would work but I want the column to be updated instantly. Which cant be achieved with a flow, it would be some delay (15 minutes). :) – Perka Mar 28 '19 at 7:50
  • 1
    You can use a SharePoint designer workflow. – LZ_MSFT Mar 28 '19 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.