Best answer

Enter dynamic date field in Zapier trigger

  • 30 June 2022
  • 4 replies
  • 512 views

Userlevel 1

Hi,

I have created a custom integration with a polling trigger where the API call looks like this:

https://au.boostlingo.com/api/web/appointment/log?q={"pageSize":50,"pageIndex":1,"sortBy":"scheduledStartTime","sortDirection":2,"userAccountId":0,"requestorId":0,"companyAccountId":20,"consumerId":null,"dateSince":"2022-06-28T14:00:00.000Z","dateTill":"2022-07-08T13:59:59.000Z","callStatusId":1,"searchString":null,"appointmentTypes":null,"callTypes":null}

 

The response is an array of logs from my system. I added “dateSince” and “dateTill” fields as input fields because they are required and there a max period of 3 months allowed between them.

 

Given that I want my trigger to always poll the latest data I need to insert dynamic dates in the input fields instead of fixed values.

I found this https://zapier.com/help/create/customize/insert-the-time-your-zap-runs-into-a-field#zap_meta_utc_iso but it seems to work only for actions steps.

 

Any idea how to achieve this?

Thank you

 

icon

Best answer by Troy Tessalone 1 July 2022, 16:21

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

Hi @Thomas2M 

Good question.

You must include a space between the modifier and the date/time value.
Multiple modifiers can be used together, and must be separated from date/time values and each other with spaces.

 

Userlevel 1

Hello @Troy Tessalone ,

 

Tried that but that didn’t seem to work (the test trigger loads forever). I’m trying another approach where instead of using a polling trigger, I have created the same API call in Zapier UI as an action. Then I start my zap with a Schedule by Zapier trigger which gives me a nice control over the polling frequency.

The only problem is that the API call returns an array of items instead of a single object. So Zapier UI doesn’t accept the response. I’ve got another API call returning an array of objects and they are treated as line items. How come it’s not the case for this one?

Response example:

{
"pageIndex": 1,
"totalPages": 1,
"totalItems": 19,
"items": [
{
"hiddenPrivacyProperties": null,
"data": {
"id": 20785,
"accountUniqueId": 216455200,
"parentAccountUniqueId": null,
"clientName": " ",
"invitedInterpreters": [
"",
"",
"",
"",
"",
"",
"",
""
],
"shortInvitedInterpreters": [
""
],
"statusId": 5,
"scheduledStartTime": "2022-07-08T04:00:00Z",
"scheduledEndTime": "2022-07-08T07:00:00Z",
"confirmedStartTime": null,
"confirmedEndTime": null,
"subject": "Domestic Violence Hearing",
"priorityId": 1,
"interpreterPriorityId": null,
"communicationTypeId": 8,
"recordId": null,
"serviceTypeId": 17,
"languageFromId": 5,
"languageToId": 33,
"location": "",
"distance": [
"45.90"
],
"scheduledDuration": "PT3H0S",
"clientInvoice": 570.00,
"clientExpenses": 120.00,
"interpretersInvoice": 180.00,
"interpreterExpenses": 0,
"accountName": null,
"actualDuration": "PT3H0S",
"clientJoinedTime": null,
"interpreterJoinedTime": null,
"otherParticipants": "",
"thirdPartyDuration": "PT0S",
"consumerName": " ",
"customFieldsData": {
"123_83": "",
"123_108": "Baron ATA",
"123_252": "7"
}
},
"requestId": null,
"fileUrl": null,
"error": null,
"logType": null
},
{
"hiddenPrivacyProperties": null,
"data": {
"id": 21140,
"accountUniqueId": 223904520,
"parentAccountUniqueId": null,
"clientName": " ",
"invitedInterpreters": [
"",
""
],
"shortInvitedInterpreters": [
""
],
"statusId": 3,
"scheduledStartTime": "2022-07-07T23:00:00Z",
"scheduledEndTime": "2022-07-08T01:00:00Z",
"confirmedStartTime": null,
"confirmedEndTime": null,
"subject": "MAG-00068552/22(2)",
"priorityId": 1,
"interpreterPriorityId": null,
"communicationTypeId": 8,
"recordId": null,
"serviceTypeId": 17,
"languageFromId": 178,
"languageToId": 33,
"location": "",
"distance": [
"40.61"
],
"scheduledDuration": "PT2H0S",
"clientInvoice": 390.00,
"clientExpenses": 0.0,
"interpretersInvoice": 0,
"interpreterExpenses": 0,
"accountName": null,
"actualDuration": "PT2H0S",
"clientJoinedTime": null,
"interpreterJoinedTime": null,
"otherParticipants": "",
"thirdPartyDuration": "PT0S",
"consumerName": " ",
"customFieldsData": {
"123_83": "",
"123_108": "",
"123_252": "1"
}
},
"requestId": null,
"fileUrl": null,
"error": null,
"logType": null
},
{
"hiddenPrivacyProperties": null,
"data": {
"id": 21341,
"accountUniqueId": 228178182,
"parentAccountUniqueId": null,
"clientName": "",
"invitedInterpreters": [
""
],
"shortInvitedInterpreters": [
""
],
"statusId": 3,
"scheduledStartTime": "2022-07-07T04:30:00Z",
"scheduledEndTime": "2022-07-07T05:30:00Z",
"confirmedStartTime": null,
"confirmedEndTime": null,
"subject": "LL-22182001",
"priorityId": 1,
"interpreterPriorityId": null,
"communicationTypeId": 8,
"recordId": null,
"serviceTypeId": 21,
"languageFromId": 33,
"languageToId": 43,
"location": "",
"distance": [
"559.19"
],
"scheduledDuration": "PT1H0S",
"clientInvoice": 142.50,
"clientExpenses": 0.0,
"interpretersInvoice": 0,
"interpreterExpenses": 0,
"accountName": null,
"actualDuration": "PT1H0S",
"clientJoinedTime": null,
"interpreterJoinedTime": null,
"otherParticipants": "",
"thirdPartyDuration": "PT0S",
"consumerName": " ",
"customFieldsData": {}
},
"requestId": null,
"fileUrl": null,
"error": null,
"logType": null
},

Is it because each item does not exactly have the same fields? 

 

Thank you

Userlevel 7
Badge +14

@Thomas2M 

The Looping app can be use to handle line items: https://zapier.com/apps/looping/help

 

Are you using a Webhook or Code Zap action step to make the API request?

Webhook: https://zapier.com/apps/webhook/help

Code: https://zapier.com/apps/code/help

 

 

 

Userlevel 1

Hi @Troy Tessalone ,

 

Great, I’m using an action step from a custom integration. I manage to fix the API call and now I get line items. The looping app is exactly what I need for my next steps thank you!