SOLVED

Sharepoint list conditionnal inlineEditField

Copper Contributor

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. 

2 Replies
best response confirmed by ganeshsanap (MVP)
Solution

@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_1-1657645710333.png

 

 

@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 👍🏽
1 best response

Accepted Solutions
best response confirmed by ganeshsanap (MVP)
Solution

@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_1-1657645710333.png

 

 

View solution in original post