I figured it out! Dexter has a built in function to strip punctuation from user triggers so I had to get around that with the punctuation stripping snippet at the top. I’m getting a proper response from the API now, here’s the code inside Dexter.
# punctopic nostrip
> object parseApiCallResults javascript
return JSON.stringify(this.httpData, null, 2);
< object
> object create_getrequest javascript
var email_encode = encodeURIComponent(args[0]);
var url_finish = "Primary%20Sheet?fields%5B%5D=First+Name&fields%5B%5D=Strength&fields%5B%5D=IP+Address&filterByFormula=%7BEmail+Address%7D%3D%22" + email_encode + "%22";
return url_finish;
< object
+ *
$ GET https://api.airtable.com/v0/<base id>/<call>create_getrequest <star></call> {"headers": {"Authorization": "Bearer <bot airtable_api_key>", "Content-Type": "application/json"}}
* ${{__status}} != 200 => Error: ${{error.message}}
- <call>parseApiCallResults</call>
What I’m having trouble with now is pulling a specific value from the GET request. The following doesn’t work.
${{records.id.fields.First Name}}, ${{records.id.fields.Strength}}, ${{records.id.fields.IP Address}}
Here is the response I’m getting from the API (removed confidential information). Any idea on how to pull the data into Dexter using these mustache tags? My suspicion is that the id is the issue here.
Okay. {
"records": [
{
"id": "REMOVED",
"fields": {
"First Name": "Catiya",
"Strength": "b-trial-standard",
"IP Address": "REMOVED"
},
"createdTime": "2020-05-25T17:03:31.000Z"
}
],
"__text": "{\\"records\\":[{\\"id\\":\\"REMOVED\\",\\"fields\\":{\\"First Name\\":\\"Catiya\\",\\"Strength\\":\\"b-trial-standard\\",\\"IP Address\\":\\"REMOVED\\"},\\"createdTime\\":\\"2020-05-25T17:03:31.000Z\\"}]}",
"__status": 200
}