Column Formatting - get value from Workflow column

%3CLINGO-SUB%20id%3D%22lingo-sub-642515%22%20slang%3D%22en-US%22%3EColumn%20Formatting%20-%20get%20value%20from%20Workflow%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-642515%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20a%20SharePoint%20Approval%20workflow%20(not%20Flow)%20on%20a%20Document%20Library.%20The%20workflow%20automatically%20gets%20an%20associated%20column%20created%20in%20the%20Library%20that%20shows%20the%20status%20of%20the%20workflow.%20All%20good%20-%20as%20expected.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIdeally%20we%20would%20love%20to%20apply%20Column%20Formatting%20on%20the%20workflow%20column%2C%20but%20it%20doesn't%20show%20up%20in%20the%20list%20of%20columns%20for%20the%20list%2C%20so%20can't.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20we've%20created%20a%20new%20column%20(Calculated%20column)%20and%20wish%20to%20get%20the%20value%20from%20the%20workflow%20column%20that%20was%20created%20using%20Column%20Formatting.%20But%20when%20we%20try%20to%20reference%20the%20workflow%20field%20it%20doesn't%20return%20the%20value%20-%20seems%20as%20though%20it%20can't%20see%20it.%20Any%20ideas%20on%20how%20we%20could%20get%20the%20value%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%20-%20if%20the%20internal%20name%20of%20the%20workflow%20column%20was%20%22Approval%22%20then%20the%20code%20we've%20used%20is%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%22txtContent%22%3A%20%22%5B%24Approval%5D%22%2C%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20works%20if%20we%20try%20to%20retrieve%20the%20value%20from%20a%20normal%20Hyperlink%20column%2C%20but%20just%20can't%20seem%20to%20get%20access%20to%20the%20value%20in%20the%20workflow%20column.%20Note%3A%20the%20workflow%20column%20is%20visible%20in%20the%20Library%20View.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20addition%20to%20this%2C%20we%20would%20like%20to%20get%20the%20description%20of%20the%20link%20-%20not%20the%20Url%2C%20but%20seems%20as%20though%20the%20.desc%20property%20isn't%20available%20to%20us%2C%20even%20from%20a%20normal%20Hyperlink%20column%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%22txtContent%22%3A%20%22%5B%24Approval%5D.desc%22%2C%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-642515%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

We have a SharePoint Approval workflow (not Flow) on a Document Library. The workflow automatically gets an associated column created in the Library that shows the status of the workflow. All good - as expected.

 

Ideally we would love to apply Column Formatting on the workflow column, but it doesn't show up in the list of columns for the list, so can't.

 

So we've created a new column (Calculated column) and wish to get the value from the workflow column that was created using Column Formatting. But when we try to reference the workflow field it doesn't return the value - seems as though it can't see it. Any ideas on how we could get the value?

 

For example - if the internal name of the workflow column was "Approval" then the code we've used is:

 

"txtContent": "[$Approval]",

 

This works if we try to retrieve the value from a normal Hyperlink column, but just can't seem to get access to the value in the workflow column. Note: the workflow column is visible in the Library View.

 

In addition to this, we would like to get the description of the link - not the Url, but seems as though the .desc property isn't available to us, even from a normal Hyperlink column:

 

"txtContent": "[$Approval].desc",

 

0 Replies