Title: "Question about <@U04T6B6HMC6>"

This topic was automatically generated from Slack. You can find the original thread here.

hi ,

Hi, how can I help you?

I would need an array of data from Hubspot. Which I then pass to Sendinblue. The data arrives in Pipedream like this {{steps.trigger.event.contact[“identity-profiles”][0].identities[0].value}}

To pass an array of data from Hubspot to Sendinblue using Pipedream, you can follow these steps: 1. First, set up a trigger in your Pipedream workflow to receive data from Hubspot. You can use an HTTP trigger or any other trigger that suits your use case. 2. Once you have the data in your Pipedream workflow, you can access it using steps.trigger.event. In your case, the data is available at steps.trigger.event.contact["identity-profiles"][0].identities[0].value. 3. Next, you’ll need to set up a step in your workflow to send the data to Sendinblue. You can use the Sendinblue app in Pipedream to make API requests. Here’s an example of how to send data to Sendinblue using a Pipedream component: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { sendinblue: { type: "app", app: "sendinblue", }, contactData: { type: "string", label: "Contact Data", }, }, async run({ steps, $ }) { const data = this.contactData; // Replace this with the data you want to send to Sendinblue // Make an API request to Sendinblue to send the data return await axios($, { url: `https://api.sendinblue.com/v3/contacts`, method: "POST", headers: { "api-key": `${this.sendinblue.$auth.api_key}`, "content-type": `application/json`, }, data: { // Add the necessary fields for Sendinblue API request email: data, // other fields as required }, }); }, }); 4. Replace this.contactData with the data you want to send to Sendinblue, which in your case would be steps.trigger.event.contact["identity-profiles"][0].identities[0].value. 5. Configure the Sendinblue API request according to your needs, such as adding other fields or updating the endpoint if necessary. This example demonstrates how to send a single contact’s data to Sendinblue. If you have an array of contacts, you can loop through the array and make API requests for each contact.

I need the Array to get all email addresses from hubspot to sent them to Sendinblue. How should the Array (Json) look like for more than 100 addresses

To get all email addresses from Hubspot and send them to Sendinblue, you can follow these steps: 1. Use the Hubspot API to fetch all contacts. You may need to paginate the results if you have more than 100 contacts. Refer to the Hubspot API documentation for details on how to fetch contacts and handle pagination. 2. Extract the email addresses from the contacts and store them in an array. The array should look like this: on [ "[email1@example.com](mailto:email1@example.com)", "[email2@example.com](mailto:email2@example.com)", ... ] 3. Loop through the array of email addresses and use the Sendinblue API to add or update each contact. You can use the Sendinblue Add or Update a contact action in Pipedream. Here’s an example of how to fetch contacts from Hubspot and send them to Sendinblue using Pipedream components: ``` import { axios } from “@pipedream/platform”; export default defineComponent({ props: { hubspot: { type: “app”, app: “hubspot”, }, sendinblue: { type: “app”, app: “sendinblue”, }, }, async run({ $ }) { // Fetch contacts from Hubspot const response = await axios($, { url: https://api.hubapi.com/crm/v3/objects/contacts, headers: { “Authorization”: Bearer ${this.hubspot.$auth.oauth_access_token}, “content-type”: application/json, }, params: { limit: 100, // Adjust the limit as needed }, }); // Extract email addresses from contacts const emailAddresses = response.results.map(contact => contact.properties.email); // Loop through email addresses and add or update each contact in Sendinblue for (const email of emailAddresses) { await axios($, { url: https://api.sendinblue.com/v3/contacts, method: “POST”, headers: { “api-key”: ${this.sendinblue.$auth.api_key}, “content-type”: application/json, }, data: { email: email, // Add other fields as