zapierzapier-cli

How can I replace {{username}} token with actual value while connecting app in Zapier


I created an APP using Zapier CLI and implemented oauth2 authentication. I connected successfully but it shows my app name like this

Zapier Test (0.1.0) {{username}}
--------------------------------
{{username}} added 27 minutes ago, used in 0 Zaps

I don't want this token here, I want to replace it with username or email ID.

enter image description here


Solution

  • You can set the connection label like this in your authentication.js file.

    connectionLabel: "{{username}}"

    username key must come from your test OAuth API

    If you test API returns data in hierarchy order like this

    {
      data: {
        email: stack@example.com
      }
    }
    

    then use this code bundle.inputData.data.email

    Read more from here, see below image if you are using UI.

    enter image description here