1

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? :)

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

1 Answer 1

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]"
}
2
  • 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
    Commented Mar 28, 2019 at 7:50
  • 1
    You can use a SharePoint designer workflow.
    – LZ_MSFT
    Commented Mar 28, 2019 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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