Hi, I’m trying to run a custom Directory Manager for entities of type Product. I’ve successfully added the custom entities, fields and the DM json file. However when running the DM I get the error DIRECTORY_FIELD failure - Field c_xxx must be a string type but is
← yes, it ends like this.
I think the issue here is that the field I’m asking to retrieve to base the directory structure off of is a multiselect field, instead of a plain input field.
I’ve tried adding a transform: { replaceOptionValuesWithDisplayNames: [ xxx ] }
option inside the DM json file but it doesn’t seem to take effect.
Any workarounds or ideas on how to get past the error?
For the time being, the Directory Manager can only handle string
field types (and the sub-properties of the address
field). Support for single-option select
fields is not supported, which I assume you are using based on your inclusion of the Stream transform
.
As a workaround, you could write the single-option select field to a separate text field (a platform function could be useful for this), and pass that to the Directory Manager configuration instead.
Support for other string-like fields is on our roadmap, hopefully slated for some time in the fall. I recommend posting this as an idea on our ideas board as well.
Best,
Luc
Hi @Luc_Yuki_Marrie thank you for your reply! I will post it to the Ideas board as I think it would be useful to add it as standard functionality.
As a workaround I had already added a standard input field and mapped it to the select field using the embedded fields syntax [[c_xxx]]
, but I will look into the platform function documentation, thanks for the suggestion!
Hi @Luc_Yuki_Marrie , I’m facing the exact same issue on a different project and this time I went ahead and created the plugin (platform function) as suggested.
I’m just not sure how to integrate the function into the DM configuration file, could you guide me please?