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.
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/9a3564ca-8f92-4fb0-875c-47cdb1bae1e6.png)
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.
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/3696e7e1-2cbf-406f-a8d5-27b45737ed11.png)
Trigger: Invitee Created
Calendly trigger data is scoped for either:
- User
- Organization
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/c35323a3-9e4f-498b-9a66-9e3191a085a7.png)
Action: Formatter > Utilities > Line Items to Text
CONFIG
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/5abfe9f7-4f6e-454c-bb1e-24a8a745ff1d.png)
OUTPUT
EXAMPLE
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/caae4d84-9273-4e49-9436-a9be17914400.png)
Action: Code > Run JavaScript
NOTE: Code created with the help of ChatGPT.
CONFIG
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/2141c289-5506-477e-b180-707bcecbf236.png)
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
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/1ce56d03-1bfa-452a-bbc2-1bb66602d45d.png)
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
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/006fc71d-d838-4313-90e1-ed9f22d4d7e3.png)