0

In my List A I have a lookup column "CODE PROJET" and one connected lookup column "FIN RECONDCT" both coming from an other SharePoint list B.

enter image description here

On a field of the A List I try to do a JSON column formating with a test on "FIN RECONDCT" coming from B.

I get fine the value of "CODE PROJET" doing [$CODE_x0020_PROJET.lookupValue] but I never get the value of the connected field "FIN RECONDCT"

I tried different solutions. But whatever name I use to get the value, I get no error (in debug mode) and no value. I tried all these =>

[$FIN_x0020_RECONDCT.lookupValue] [$CODE_x0020_PROJET:FIN_x0020_RECONDCT.lookupValue] [$CODE_x0020_PROJET.FIN_x0020_RECONDCT.lookupValue] [$CODE_x0020_PROJET:$FIN_x0020_RECONDCT.lookupValue] [$CODE_x0020_PROJET.$FIN_x0020_RECONDCT.lookupValue]

Please can somebody help me?

1 Answer 1

0

See: SharePoint Online: Using JSON Column Formatting to get lookup column value inside Form

And: JSON formatting column based upon added column of lookup column

Ensure you are formatting like this [$YourLookupColumn.lookupValue]

And that the lookup column is returning the expected data type.

If you’re still having trouble, provide more details about the lists and the exact error message you’re encountering.

Heres an example with a column called Productgroup_x003a_Min

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "[$Productgroup_x003a_Min]",
  "attributes": {
    "class": "=if (@currentField < [Productgroup_x003a_Min],'sp-field-severity--warning', '')"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "display": "inline-block",
        "padding": "0 4px"
      },
      "attributes": {
        "iconName": "=if (@currentField < [Productgroup_x003a_Min],'Error', '')"
      }
    },
    {
      "elmType": "span",
      "txtContent": "@currentField"
    }
  ]
}
3
  • Hi Martin, the previous url talk about LookupColumn coming from the same list. Mine is coming from another list...
    – Patgat
    Jan 4 at 9:42
  • Are you certain you are using the correct column names? The internal name usually replaces spaces with x0020 sharepoint.stackexchange.com/questions/297644/… Jan 4 at 16:44
  • Yes I am. If you look to my first post you will see i tried with "x0020" also. In your exemple it does not look to be a lookup column coming from another list. Does it?
    – Patgat
    Jan 4 at 18:04

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.