SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

JSON Form formatting: Unable to use the calculated column value in header/footer layout customization #8788

Open ganesh-sanap opened 1 year ago

ganesh-sanap commented 1 year ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

Declarative list formatting

Developer environment

None

What browser(s) / client(s) have you tested

Additional environment details

No response

Describe the bug / error

Unable to use the calculated column value in header/footer layout customization using JSON list formatting. Calculated column value can be used in column/view formatting.

The calculated column value is available in the page context but it is not shown in form header:

image

Steps to reproduce

  1. Create a simple calculated column in SharePoint list. For example using formula: =[Title]
  2. Open list form > Edit form > Configure layout > Header
  3. Add JSON in below format and Save
{
    "elmType": "div",
    "txtContent": "='Value: ' + [$CalcPH]"
}

Expected behavior

Customized list form header/footer should show the calculated column value without any problem.

ghost commented 1 year ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

aaclage commented 1 year ago

Hi @ganesh-sanap

Based on microsoft link looks like your column type "Calculated" is not supported: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/list-form-conditional-show-hide#unsupported-column-types-in-conditional-formulas

ganesh-sanap commented 1 year ago

@aaclage I am not using it in conditional formulas to show/hide fields. I am using it in JSON form formatting in header/footer layouts: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/list-form-configuration

aaclage commented 1 year ago

Hi @ganesh-sanap , Yes, the reference is on the formulas, don't know if is relate, did a test with reference field "metadata..." and didn't work also and found this chapter.

Better is to wait for a response from @shagra-ms

ganesh-sanap commented 1 year ago

@aaclage Conditional formulas to show/hide fields and JSON form formatting are different functionalities and are not related to each other.

Hoping to hear something related to this issue from @shagra-ms in near future. Thanks in advance for any related information why calculated column does not work in JSON form formatting.

RobotRise commented 1 year ago

Also experiencing this same issue

TheGooginator commented 1 year ago

I ran into this thread as I am having the same issue with calculated column not appearing in my Microsoft List Header. Wondering if we can get an update from Microsoft on the status of this issue.

ganesh-sanap commented 1 year ago

Hi @shagra-ms, any update on this issue? Thanks!

mikedelic commented 1 year ago

Also having this same issue.

DeeJaWue commented 2 months ago

Same Issue here...