Hey community, i hope you can help me with a filtering problem, the situation is: I have a derived field used from other source like this:
const companyCodeByName = {
name: 'company_code',
label: 'company_code',
type: 'ATTRIBUTE',
dependencies: ['company_name'],
reverse: (item) => {
const filters = cf.getIManager().get('api').getFilters();
const nameFilter = filters.find((f) => f.getLabel() === 'Company Name');
const companyName = nameFilter && nameFilter .getValue()[0];
return getCompanyCodeByName(companyName, item);
},
function: (item) => {
let name = item.companyNames[0];
return name;
},
};
And in my main source i have this field definition in the metadata:
"MainSource": {
fields: {
company_name: {
label: 'Company Name',
type: 'ATTRIBUTE',
},
company_code: {
label: 'Company Code',
type: 'ATTRIBUTE',
},
},
},
When I try to apply a filter selecting the company code from my derived field the widgets with my main source are not filtered.
I did something wrong?