Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions content/guides/embed/ui-elements/explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ function App() {

// Define metadata source
// Example: enterprise_123456789.metadatatemplate
const metadataSource = `metadata.enterprise_${EID}.${templateName}`;

const metadataSource = `enterprise_${EID}.${templateName}`;
const metadataSourceFieldName = `metadata.${metadataSource}`;

const metadataQuery = {
from: metadataSource,

Expand All @@ -368,22 +369,22 @@ function App() {

// Define which other metadata fields you'd like to display
fields: [
`${metadataSource}.name`,
`${metadataSource}.last_contacted_at`,
`${metadataSource}.industry`,
`${metadataSource}.role`,
`${metadataSourceFieldName}.name`,
`${metadataSourceFieldName}.last_contacted_at`,
`${metadataSourceFieldName}.industry`,
`${metadataSourceFieldName}.role`,
],
};

// The metadata fields/columns to view - must be valid field names from the metadata template
const fieldsToShow = [
// Determine if the user can edit the metadata directly from Content Explorer component
{ key: `${metadataSource}.name`, canEdit: false },
{ key: `${metadataSourceFieldName}.name`, canEdit: false },

// Determine label alias on metadata column with displayName prop
{ key: `${metadataSource}.industry`, canEdit: false, displayName: "alias" },
{ key: `${metadataSource}.last_contacted_at`, canEdit: true },
{ key: `${metadataSource}.role`, canEdit: true },
{ key: `${metadataSourceFieldName}.industry`, canEdit: false, displayName: "alias" },
{ key: `${metadataSourceFieldName}.last_contacted_at`, canEdit: true },
{ key: `${metadataSourceFieldName}.role`, canEdit: true },
];

// defaultView - a required prop to paint the metadata view.
Expand Down
Loading