Skip to content

Instantly share code, notes, and snippets.

@shaisachs
Last active September 18, 2017 16:58
Show Gist options
  • Save shaisachs/82c474a2677734a665eb3db7c3503764 to your computer and use it in GitHub Desktop.
Save shaisachs/82c474a2677734a665eb3db7c3503764 to your computer and use it in GitHub Desktop.
ActionTag - prefill a custom field input
// see https://developers.everyaction.com/action-tag#callbacks-alterfill
// assumes your Custom Field ID is 1234
function populateCustomField(args) {
if (args.fill_source !== 'FastAction') {
return args;
}
if (!args.fill_dict['CustomField_1234']) {
args.fill_dict['CustomField_1234'] = preFilledCustomFieldValue();
}
return args;
}
function preFilledCustomFieldValue() {
// determine the appropriate value for this person...
return 'foo';
}
var nvtag_callbacks = nvtag_callbacks || {};
nvtag_callbacks.alterFill = nvtag_callbacks.alterFill || [];
nvtag_callbacks.alterFill.push(af);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment