Instructions for Matching a Candidate's Telephone Number in Zapier (When Prefixes Differ)
Follow these steps to configure your Zap in Zapier to handle variations in phone number prefixes, such as switching between +44 and 0.
1. Configure the 'Find Person by Phone' Step
- In the Find Person by Phone step, go to the Configure stage.
- In the "If no search results are found" section, set it to Mark "successful".
2. Add a Path Step
- After the Find Person by Phone step, add a Path step.
3. Set Conditions for the First Path
- In the first path's conditions:
- Set the rule to Only continue if "ID" is "Exists".
- Under this path, add a step to update your ATS with the candidate's information.
4. Configure the Second Path (Fallback Rule)
- In the second path, set the rule type to Fallback.
5. Add a Code Step in the Fallback Path
- Under the fallback path, add a Code step.
- For the Action Event, select Run JavaScript.
6. Configure the Code Step
- In the Configure section of the Code step:
1. Set the input data field to include the candidate's phone number (e.g., candidate number
).
2. Enter the following JavaScript code:
let phone_number = input_data['Phonenumber'] || '';
// Convert the phone number from +44 to 0 prefix
if (phone_number.startsWith('+44')) {
var converted_number = '0' + phone_number.slice(3); // Replace +44 with 0
} else {
var converted_number = phone_number; // Return unchanged if it doesn't start with +44
}
// Prepare the output
output = { 'converted_number': converted_number };
This setup will handle cases where a candidate's phone number is entered with a +44 prefix, converting it to the 0 format if necessary. If the prefix is already correct, it remains unchanged.