Hi, following on from this post, https://community.m-files.com/forums-1552881334/f/m-files-api/5921/write-mutli-select-property-from-value-list
In that thread I managed to work out how to build a list of all the Workflow States that a document has passed through, and ignore duplicates. It will successfully populate a 'Choose from list "Workflow States" (multi select)' property, H.Property.DocumentStates, so that thread is now Answered
The follow on question is about filtering in the Search. I want to let users Filter their Search results by this DocumentStates property, but unfortunately it shows *every* Workflow State from every Workflow. I want it to just work on the Document's Workflow's States. I can't apply a Filter to the H.Property.DocumentStates so it only filters by the relevant Workflow, and I'm not sure why
If I create a new Value List & Property, H.Property.DocumentStates2, I thought I could pre-populate that value list with matching names for the doc States, and then write my list there, possibly by matching with DisplayValue? but I'm getting Type Mismatches and I think I'm attempting this the wrong way
Essentially my question: is can I read the current Workflow State (from the Workflow State property, which is draws from the Workflow State Value List) and then add those values to my new Document State property, which draws from a Document State Value List?
Many thanks