Module Assessment | Yext Hitchhikers Platform
Background
You love the idea of the Admin Console - it could make it significantly easier to add or make changes across different resources. In this challenge, your account has everything from the Content track – you have:
- Restaurant entities
- FAQ entities
- Job entities
- Event entities
You want to modify some resources in your account directly via Admin Console. Specifically, you want to add a new custom field and update the fields on a couple of entity types.
Your Challenge
From the navigation bar, click Developer then click Admin Console. This should launch the Admin Console in a new tab.
Look around at the various files. If you completed the Content track you should be very familiar with the resources you added. Open up all of the directories to see everything that’s there.
Click on “Settings” and check off Friendly Name Mode and click “Save”. Note how the names for things like templates and labels are now readable.
Time to make some changes! Navigate to
km/field-eligibility-group/job.default.json
so you can add the primary CTA custom field to the type. In thefields
array, add the primary CTA field:"c_primaryCTA"
Click the “Add Resource” button to add a new field for event disclaimer.
- Select “Knowledge Manager”.
- Select “field”.
- Enter the resource name as
eventDisclaimer
. - Click “Create” — the system will add a file template for the field resource type. You’ll notice that the
$id
for this new field will actually show asc_eventDisclaimer
. Thec_
prefix denotes a custom field (as opposed to a built-in one). This follows the default resource naming pattern.
Modify the new field resource with the field metadata:
- Add this
description
so your field has a tool-tip: “Enter any event disclaimers here, like public health, city ordinances, capacity concerns, etc.” - Delete the
descriptionTranslation
array object (this should be multiple lines). - Add a
displayName
of “Event Disclaimer”. - Delete the
displayNameTranslation
array object (this should be multiple lines). - Update
group
to “NONE”. - Update
localization
to “PRIMARY_ONLY”.
Make sure you have no JSON syntax errors. All strings should be enclosed in quotation marks. Just like in the Search frontend code editor or backend configuration editor, you should see red underlining and red notation if there is an error detected in the syntax.
- Add this
Update the field’s type. In the
type
object, remove everything except for thestringType
object.- Update
stereotype
to “MULTILINE” to set to subtype of Multiline text. - Update the
maxLength
to 200 to add custom validation. - Remove the
minLength
. - Update the
typeId
to “string”.
You want the field to be similar to the
c_deliveryDisclaimer
field you created in the UI, so you can use that as a reference point if needed.It should look like this:
"type": { "stringType": { "stereotype": "MULTILINE", "maxLength": 200 } }, "typeId": "string"
- Update
Navigate to the file for the Event entity type field eligibility group file (
km/field-eligibility-group/event.default.json
).Add the new
c_eventDisclaimer
field to the field array.Review the changes you’ve made so far by clicking the “Show Diff” button at the top. Select to “View diffs for this account” and click “Continue”. You should see one added file and two edited files — your new event disclaimer field, the event type, and the job type.
Close out of the View Diff dialog and apply your changes by clicking “Apply” in the top-right. Select “Apply to this account” and click Continue. You can leave the Namespaces field empty. As in the previous step, you should see the same three files as diffs. Review these to make sure they look right according to the instructions and then click Continue.
Review the confirmation dialog. When you are ready, click “Confirm”.
Monitor the console for any errors or issues. If you have any errors, try to debug and retry. You can reach out to the Community if you need assistance.
Return to your account and navigate to Content > Configuration > Fields. Click into the Event Disclaimer field - you can see that any changes applied through Admin Console appear in your account.
On the Event Disclaimer field in the UI, click into the Field Specification and update the validation to have up to 400 characters instead of 200 and click “Save”.
Return to the Admin Console. Since you just made a change in your account, you want to make sure that you have the latest data from your account. If you still have your tab up, do a hard refresh to pull in fresh configuration files (Ctrl+Shift+R on a PC or Command+Shift+R on a Mac). Otherwise, you can re-launch the Admin Console by navigating to Developer > Admin Console.
Navigate to the Event Disclaimer field (
km/field/eventDisclaimer.json
) to see the changes you made in the UI.