Forum Discussion

JulienG_'s avatar
JulienG_
Copper Contributor
Mar 31, 2022

Sharepoint list conditionnal inlineEditField

Hello,

 

Is there a way to make inline editing active according to a value in another column of the list ?

 

e.g. if I have two text columns called "Editable" and "FieldName", could I get an inline editing of the cells "FieldName" only if the cell "Editable" is equal to "Yes" ?

 

I have tried

 

 

{
  "elmType": "div",
  "inlineEditField": "=if([$Editable]=='Yes',[$FieldName],'')",
  "txtContent": "[$FieldName]"
}

 

 

 and

 

 

"inlineEditField": {
	"operator": ":",
	"operands": [
	  {
		"operator": "==",
		"operands": [
		  "[$Editable]",
		  "Yes"
		]
	  },
	  "[$FieldName]",
	  ""
	]
},

 

 

 

Thanks for your help. 

  • JulienG_ this is not possible by design.  Instead, you can setup multiple elements that display or hide based on status.  Using your example, you would want to set up your json like the image below.  Lines 1-8 show the element that is editable inline when [$Editable]=='Yes'.  However, that field is "No" the editable element will not show (i.e. display is set to none) and the non-editable element will show up instead.

     

     

     

  • jphepp3's avatar
    jphepp3
    Copper Contributor

    JulienG_ this is not possible by design.  Instead, you can setup multiple elements that display or hide based on status.  Using your example, you would want to set up your json like the image below.  Lines 1-8 show the element that is editable inline when [$Editable]=='Yes'.  However, that field is "No" the editable element will not show (i.e. display is set to none) and the non-editable element will show up instead.

     

     

     

    • Ryan_Finance's avatar
      Ryan_Finance
      Copper Contributor
      jphepp3 Your response didn't get the credit it deserves... What may have been the simplest thing for you, has just solved my nightmare. Thanks for posting this comment. You are the real MVP 👍🏽

Resources