Using custom fields with JobRelay

Supported services: Broadbean

Sometimes you may want to send data to your website from Broadbean which is outside of the data supported by JobRelay.

For example, say you are recruiting for airline pilots, you may want a consultant to be able to select the type of Aircraft the candidates will be flying. It would be good to have a dropdown field in Broadbean to choose the aircraft type.

As you can see from the field reference guide, aircraft type is not included in the data feed from Broadbean, therefore we can’t save aircraft type in WordPress.

Add custom data as a custom field

To overcome this problem, we can use of the the 5 available custom fields. Each of these is presented as a dropdown (multi-select) in Broadbean. All we need to do, is map the value sent to be saved in WordPress and inform Broadbean what the dropdown options.

Map the custom field value to be saved in WordPress

All data that is sent in the JobRelay feed, can either be saved in WordPress as post meta or as terms in a custom taxonomy.

If you want to save the values as terms in a custom taxonomy, add the new mapping to the taxonomy mappings setting on the JobRelay settings page.

For example:

{
	"custom_taxonomy_name":"custom_field_1"
}

In the example above, the value sent from Broadbean in the custom_field_1 field, will be saved as a term in the custom taxonomy called custom_taxonomy_name.

If the custom field is going to be saved as post meta, entered the mapping into the meta mapping settings, like so:

{
	"custom_field_name":"custom_field_1"
}

In the example above, the value sent from Broadbean in the custom_field_1 field, will be saved as post meta using the meta key of custom_field_name.

Provide Broadbean with a list of custom field choices

All custom fields are multi-select inputs in the Broadbean job advert interface. We can provide a list of the values to present to the consultant. To do this, the choices need to be added to the field listings endpoint.

If you are saving the custom field value as a taxonomy term (see above), simple add the choices you want available in Broadbean, as terms in your custom taxonomy. This is the same process as adding categories to your blog.

If you are saving the custom field value as post meta (see above), you can provide a list of choices, using the Field Listings setting on the JobRelay Settings page.

Enter your choices like so:

{
	"custom_field_1": {
		"Option 1":"Option 1",
		"Option 2":"Option 2",
		"Option 3":"Option 3"
	},
	"custom_field_2": {
		"Option 1":"Option 1",
		"Option 2":"Option 2",
		"Option 3":"Option 3"
	}
}