Hello guys,
Could anyone help me to filter the list or library control based on column "ProcessGroup" based on the TermName or TermGuid? TermGuid should be unique, so the unique GUID is:
{
"Label": "6",
"TermGuid": "c0ba954f-6113-422b-ba0e-d36c4735089e",
"WssId": 6
}
I have the term translated to 4 languages.
Tried this approach, unsuccessful.
fd.control("libraryCorporateManagement").ready(function () {
fd.control(
"libraryCorporateManagement"
).filter = `<Eq><FieldRef Name='ProcessGroup' /><Value Type='Value'>F1 Corporate Management</Value></Eq>`;
fd.control("libraryCorporateManagement").refresh();
});
Also tried with - the same result.
Working solution - unpractical - In one Term I have around 100 records. Working solution is to set it by ID which I have to find out with this script
pnp.sp.web.lists
.getByTitle("Published Documents")
.items.select("Title", "ProcessGroup")()
That returns the items from the document library and select TaxonomyField and when I click to show the data, I see what I posted in script section at the top of the topic.
fd.spRendered(() => {
// Set Corporate Management F1 - ID === 6
fd.control("libraryCorporateManagement").ready(function () {
fd.control(
"libraryCorporateManagement"
).filter = `<Eq><FieldRef Name='ProcessGroup' LookupId='TRUE' /><Value Type='Lookup'>${6}</Value></Eq>`;
fd.control("libraryCorporateManagement").refresh();
});
// Set the Corporate Management F1.01 Organizational Chart
fd.control("libraryOrganizationalCharts").ready(function () {
fd.control(
"libraryOrganizationalCharts"
).filter = `<Eq><FieldRef Name='ProcessGroup' LookupId='TRUE' /><Value Type='Lookup'>${30}</Value></Eq>`;
fd.control("libraryOrganizationalCharts").refresh();
});
// Label Document Type - 10,31,7,1,18
});
If you would know about different approach, I would be grateful. Please, do not send me anything about MultipleValues. My TaxonomyField is a single choice.
Thank you in advance
Stepan