0

I have a field name called Security(choice field) and other field name is Sensitivity. I want to copy the values of Security in Sensitivity in the list view. For example if value of security is Internal then in sensitivity column also it should show Internal in the list view only irrespective of the values stored in sensitivity. In laymen term Both field should show same values. I am new in spfx environment. Please help. I am using react framework. Let me know if you need any other details.

PS- I have 400k libraries consisting same column with same internal name so column formatting option is not suitable. we need o deploy as an extension so that it will change listview across all libraries.

1 Answers1

0

In SPFx Field Customizer, implement the onRenderCell with below logic:

The method has signature as follows:

public onRenderCell(event: IFieldCustomizerCellEventParameters): void 

Use below code to get the Security field value:

const securityValue = event.listItem["_values"].get("Security");

Once you get the item id, you can get the value of other field from same item.

Return the value as:

event.domElement.innerHTML = `<div>${securityValue}</div>`

Source: change value of one field on the basis of other using spfx field customizer

Ganesh Sanap
  • 1,386
  • 1
  • 8
  • 18