Using Smartfill on Contract Channel Posting Requirements
Version 2.5 added ability to prefill Contract Channel Posting Requirements through the help of AI (Large Language Models).
Please consult with your Partner Account Manager to get this feature enabled for your ATS.
When the end user is filling in the contract channel posting requirements form in the order journey, above the form, user sees a button [AI] Smartfill
. Upon clicking this button, the description and data from previous order journey steps they provided gets sent to AI and a polling is added to keep track of the progress of the task created by HAPI Backend Posting Requirements Smartfill Endpoint. When task is marked as "completed", the data returned by HAPI Backend gets set on orderedProductsSpecs
property of campaignForm
object corresponding to the ID of the contract.
If user has already entered information into the fields, then they click the button, the information they entered will not get overwritten.
Triggering the smartfill without user action
Posting Requirements smartfill can be triggered by running the service function:
window.hapi.campaign.service.createSuggestionOfPostingRequirements.run()
By default, when user clicks the [AI] Smartfill
button, campaignForm object is sent to HAPI Backend Posting Requirements Smartfill Endpoint. You are most likely prefilling some of the information in the campaignForm
object however if you want to provide another description than the one you prefill, or you want to pass a custom context object of your own that has lots of campaign related data, you can check the arguments of createSuggestionOfPostingRequirements
service function by checking the Typescript definition and pass your own description/data.
Denylisting Posting Requirements Fields
This feature was added in version 3.1.
To exclude some fields via dot notated paths:
window
.hapi
.campaign
.utils
.excludedDotNotatedObjectPathsOfCampaignFormForSmartFillPostingRequirements = [
// array of dot notated paths in format `contract_id.field_name`
"e3ae108a-1044-4be7-9792-1fc77ba5b5bf.Contact_Salutation"
]
When the smartfill request succeeds, the paths in the array will be converted to orderedProductsSpecs.contract_id.field_name
and orderedProductsSpecsLabels.contract_id.field_name
so that both the value and the associated label is skipped when we set the campaign state campaignForm
variable.
You must set the array value before you manually trigger the smartfill request to backend or before user clicks the Smartfill button.
The name of the posting requirement can be obtained from the network tab of the browser for the associated contract request or through the help of campaign form debugging tools. To turn on campaign form debugging tools you can open ELEMENTS DEBUG
panel and turn on Show Campaign Form Debugger
in Campaign
tab of the debug panel. Then the posting requirements form will show debugging information that you can grab the name of the field from.
The ID you see here is the ID you need to use for the contract_id
part of the string
Requirement name
is the field_name
to use part of the string when specifying excluded fields.