Skip to main content

Copying Campaign Name to Posting Details Title

Campaign Name is used by the recruiter to easily differentiate campaigns in the campaign list. Posting Details title is what is going to be listed on the Job Board.


Campaign name could be "Software Development Manager" while the posting details title could be "Want to lead a Team of Software Developers? Join us" or "Come work for us, we're looking for amazing Software Developers".


Although we don't recommend, you may want to copy the Campaign Name to Posting Details Title. Below are some code snippets on how to do that.

How can we programmatically copy Campaign Name to Posting Details Title?

const copyCampaignNameToPostingDetailsTitle = (campaignName) => {
window.hapi.campaign.state.campaignForm = window.hapiUtils.mergeDeepOverwriteArrays(
window.hapi.campaign.state.campaignForm.value,
{
postingDetails: {
title: campaignName
}
}
);
}

How can we make it so that campaign name is automatically copied to posting details title when changed?

caution

This leads to bad user experience as the Campaign name and Job title fields are on back-to-back thus if you type in Campaign name field and, it copies automatically to the Job title field right below, it looks weird and, it makes the end user wonder why there are two different fields if the value is going to be exactly the same. We suggest that you hide campaign name field instead of implementing this auto-copy behavior.

window.hapi.campaign.state.campaignForm.onChange(form => {
copyCampaignNameToPostingDetailsTitle(form.campaignName)
})

How can we hide Campaign name field?

Please refer to Inspecting the iframe DOM to find the selector for campaign name and then hide the element with query selector.