box/box-ui-elements

Content Explorer - display Metadata

KevinForys opened this issue · 3 comments

Hi!

I'm currently trying without success to display metadata on the Box Content Explorer (Box UI Elements v15.0.0).

I follow this article : https://medium.com/box-developer-blog/integrating-box-metadata-querying-inside-ui-elements-with-react-c23519d5d092

This feature is available ? I read nothing on the official documentation.

Thanks to the community.

@KevinForys It seems that this feature was left undocumented but should still be available in the current version. When looking at the github sample app via the link that you linked, I noticed that metadataColumnsToShow should be fieldsToShow now. Try using fieldsToShow and let me know if that works

It's still not working but I have more informations :)

Here's my code :

 const mdQuery = {
      from: "enterprise_XXX.METADATA_TEMPLATE_KEY", 
      ancestor_folder_id: '0',
      query: "user_extra_name ILIKE :userExtraName",
      query_params: {
        "userExtraName": "User Super Name"
       }
    };
 
    const fieldsToShow = [
      { name: "user_extra_name", canEdit: false }
    ];
    const defaultView = "metadata";

On the network console, I see that the metadata request is correct and the response too : I obtain a status code 200 with a list of correct entries but the Content Explorer can't display the result.

Request JSON payload :

{
	"from":"enterprise_XXX.METADATA_TEMPLATE_KEY",
	"ancestor_folder_id":"0",
	"query":"user_extra_name ILIKE :userExtraName",
	"query_params":
		{"userExtraName":"User Super Name"},
	"limit":50,
	"fields":["name"]
}

The widget error :

ContentExplorer.js:136 TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at MetadataQueryAPIHelper.js:164:34