GUIDE: Parse Calendly Questions & Answers (Line Items) with Formatter and Code to Use as Custom Variables
Contribution by Troy Tessalone
Troy is a Certified Zapier Expert who puts Programmable Productivity to work for YOU!
Apps
See more below.
About
This is applicable to the Calendly Zap app version released at the end of September 2023.
Issue
The Calendly Zap app now returns a different data structure than the previous version.
That means it's likely your dependent Zap action steps will need to be updated.
Also, the returned data payload has these field variable changes:
- Some variables have changed names.
- Some new variables are available.
- Some previous variables no longer available.
- UUIDs (Universally Unique Identifiers) are no longer available as individual variables.
Apps
Steps
- Trigger: Calendly - Invitee Created
- Action: Formatter > Utilities > Line Items to Text
- Action: Code > Run JavaScript
- Action: ???
- Your choice!
NOTE: The reason this solution isn’t all done using 1 Code step is because of the way Zapier returns arrays of line items and the possible existence of commas in those values.
Trigger: Invitee Created
Calendly trigger data is scoped for either:
- User
- Organization
Action: Formatter > Utilities > Line Items to Text
CONFIG
OUTPUT
EXAMPLE
Action: Code > Run JavaScript
NOTE: Code created with the help of ChatGPT.
CONFIG
CODE
let QA = inputData.QA; // QA = Questions & Answers
// Split the input string into an array of items using '^' as the delimiter
QA = QA.split('^');
// Initialize an object to store questions and their corresponding answers
let SET = {};
// Iterate through the items and add them to the object
for (const item of QA) {
const fquestion, answer] = item.split('|');
SETpquestion] = answer;
}
output = <{SET, QA}];
OUTPUT
EXAMPLE
ACTION: ???
How the new variables show when using the ‘Custom’ option to map variables between Zap steps.
TIPS
To narrow down the available variables from previous Zap steps:
- Search for “SET”
- Search for a variable name
- Search for a variable value