It can be difficult to get people to fill out custom fields properly. Instead, you can configure Acrolinx to extract data from your content and automatically populate your custom fields.
Suppose that you have custom fields for "product" and "department" that writers should fill in with every check. You can configure Acrolinx to fill in these fields automatically whenever someone checks content.
Important
This feature only works with structured documents. If you have an XML file that has "product" and "department" attributes in the header section, you'd write XPath expressions for your custom fields. That way, Acrolinx knows where to find the relevant data.
To set up automatic data mapping, follow these major steps:
Before you collect data, make sure to set up your document-level fields to receive the data. This feature is only available for document-level fields because document-level data doesn't apply to other field types.
To configure custom fields to receive data from your content, follow these steps:
-
Navigate to Reporting > Reporting settings > Custom Fields and select the DOCUMENTS tab.
-
In the Input Type column, select the option From Content for each relevant field.
-
-
If the field doesn't exist yet, click ADD FIELD and choose From Content as the Input Type.
-
Once you've set up your fields, you can head over to the Content profiles section for the next step.
-
Open the content profile for your intended file type.
Tip
Example: You want to extract data from HTML meta tags. Let's suppose that you have a content profile for HTML files called "Published HTML." Open that content profile and select the DOCUMENT INFORMATION tab. You should see the document-specific fields that you added previously. If you added the "Product" and "Department" fields, you'll see them in the DOCUMENT INFORMATION tab.
-
In the location field, enter an XPath that defines where to find your data.
For example, suppose that you want to extract the product name from the following meta tag.
<meta name="Product.Name" content="Widget Detection API">
In this case, you would enter the following XPath.
//meta[@name="Product.Name"]/@content
Your changes take effect immediately.
The following table shows some more examples of XPaths for different file formats.
File type |
Target content |
Corresponding XPath |
---|---|---|
DITA |
The topic title in the following code block. <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd"> <topic id="topic_hdx_w2s_2p"> <title>git: Distributed and Shared Access to Content</title> |
/topic/title |
HTML |
The document name in the following code block. <meta name="Product.Version" content="Version 6.2.173"> <meta name="Document.Name" content="Widget Detection API Developer's Guide"> <meta name="Document.Id" content="192893721"> <meta name="Date.Created" content="2019/2/1, 16:08 (GMT)"> |
//meta[@name="Document.Name"]/@content |
Once you've set up a custom field, it's time to see if it works!
To test your data-mapping configuration, follow these steps:
-
Check a document that will match the content profile.
For example, if you just edited the "Published HTML" content profile, you would check an HTML file published on your website.
After the check has finished, open the Scorecard and check that the matching content profile is the one that you just updated.
-
Go to Settings > Troubleshooting > Check history.
-
Select your field:value combination in the Field filter.
For example, suppose that you checked a document with the following meta tag
<meta name="Product.Name" content="My Test Product">
You want to see if Acrolinx correctly extracted the value "My Test Product. In this case, you'd look for "Product: My Test Product" in the Field filter.
The following screenshot shows how the field filter would look if data were successfully extracted from our example meta tag:
You'll know that the extraction was successful if you see the Scorecard for the file you just checked.
If you don't see the Scorecard, check the extraction settings in the content profile. Acrolinx can't extract data from excluded or ignored elements.