Best answer

Update input fields programmatically

  • 11 March 2020
  • 1 reply
  • 292 views

Userlevel 1

Hello,

I'm working with the CLI version of Zapier and I have a question concerning the bundle.inputData.

The scenario is as follows:

  1. I have a hidden trigger, that fetches a list of campaigns (id, title, token) that creates a dropdown for the the user to select the campaign where new contacts should be created in our app.
  2. I have a "contact create", that makes an API call creating new contacts in the selected campaign.

The problem:

The tokens, that are returned in (1) have a lifetime of one hour, so if they expire I have to fetch new tokens. Unfortunately this hidden trigger is only called once, that is when the user creates a new zap and selects the destination campaign.


It it somehow possible to call that trigger from within my "contact create", so that I can update those tokens, if they are expired?


Kind regards,

Marko


icon

Best answer by ikbelkirasan 13 March 2020, 01:29

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.

1 reply

Userlevel 7
Badge +11

Hi @Marko 

I think that you should fetch the campaigns list in your `contact create` action to get the token that matches the selected campaign ID before calling the API to create contact. It might sound like a redundant work, but the purpose of the hidden trigger you set up is actually to help the user see a list of the available campaigns. This is only called at design time when the user is setting up the zap, which implies that you should fetch the campaigns list on every run of the `contact create` action.