Extract values from an array to a html layout

I have the following scenario.

  1. Airtable - Watch Records - Looks for selected company (a checkbox field)
  2. Aggregator - Collects all the companies where the checkbox has been checked [Values collected are: Name, Company description, Website]
  3. Mailchimp - Create a campaign - Creates a mailchimp campaign with a predecided template.
    I am using the html layout of the template in the mailchimp module. I want to extract the company description values for all the companies in the array and output them in the html template at specific places. Which function would I need to use? Also it would be good if an example of the syntax is given. I tried map and slice functions but it gives me null values even if the input is correct.

@Chandrika_Shenoy

If you’re outputting to html then I’m guessing you need to do

join(map(<array>;company description field);<br>)

If that doesn’t work can you export the blueprint and share here so we can see exactly what you’re trying?

Thanks

Simon

2 Likes

Welcome to the Make community!

To help us help you, please provide the following details about your scenario:

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

Hi,
Thank you for you response. Here is the blueprint.
blueprint.json (81.1 KB)

I am using the following formula which gives me null values as output bundles.


{{2.array[].`Company Description`}}.{{slice("0,1")}}

image

It appears the blueprint has been edited so it’s unusable. When importing the blueprint the error message is

Screenshot_2023-11-17_131115

Could you try exporting the blueprint again? Thanks

2 Likes

Would it be okay if I share the html layout instead? Due to IP rights, I may not be able to share the complete blueprint.

This is the output from the aggregator.

I only want the company description from all 4 collections at separate instances in the html layout. I used the join formula as you suggested. I am unsure if this is the right syntax.
image
This is the output I get from the mailchimp module.
output of mailchimp module

@Chandrika_Shenoy You say you want to retrieve the description and place them at seperate places within your HTML. Now;

  • Does it matter where exactly you place these in th HTML? Or does it has a set structure?
  • Is the array you get with these collections always in the same order?

If you want to get a specific item from the array and you know which position this is (and always will be) you can use the get()

{{get(get(2.Array; 1); "Company Description")}}

if the order is not always the same, you would need something to filter the array. So every collection should contain some kind of ID so then you could map() it and retrieve it.

2 Likes

I tried using get. I get the following output:
image

please take a camera-viewfinder-duotone screenshot of your scenario along with the relevant module configurations and share-all-duotoneshare the images here so that the community has a deeper understanding of how we could help.

2 Likes

Here are the screenshots

  1. Scenario
  2. HTML layout where I want the company description with the get and map function

    3.Aggregator input from watch records

    4.Aggregator output

    5.Mailchimp input bundle
  3. Mailchimp output bundle

@Chandrika_Shenoy Please read my answer above again, see if you can answer my questions and implement the code I provided.

Right now it looks like you are not fully reading it all

3 Likes

Hello,
This actually worked. Yes the place where the text is placed is fixed and the array collections will be in the same order.
Thank you so much. I have been trying various combinations of get and map now but this one actually worked. Once again, thank you very much!

I also wanted to ask, is there a good website or video where I can get the correct ways of using the various Make functions?

Thanks
Chandrika

Good to hear @Chandrika_Shenoy ! Let me know if you require any more assistance.
There is some good beginner material on the Make Academy and if you want to get some more expertise I recommend the program from Techflow

2 Likes