Hello,
I discovered a bug in JSON forms. I have a datagrid of various components. They are all populated with user specific values, once the user is selected. That is done by building a json variable "j" and passing it to:
instance.root.getComponent("datagrid").setFieldValue(j);
One of the components in the datagrid is a Select component. Its data source type is custom and it queries all organizations and displays their ID + Name.
If a user has an employment (row in datagrid) with specific organization selected, this component takes the value specified in the json variable. Otherwise it should remain empty (as shown in the next image).
Until now, I was setting all the empty fields in the json variable to empty string (""), which works well for most components. Setting the Select component value to "" however, did not work.
The issue is that Select component which was supposed to remain empty somehow got the value from the previous populated row. See image below. I believe this behavior is not correct.
As a fix, I figured out, you can set the value in the json variable to null. I hope this comes in handy, should anyone stumble upon the same issue.
Nik