Random Quote Generator

:bullseye: What is your goal?

I have a Random Quote Generator But there is a problem with formula

:thinking: What is the problem?

I think text rather rather than a calculation

:test_tube: What have you tried so far?

Read the existing on this

:link: Create public scenario page

Is there a syntax problem and the formula?

:camera_with_flash: Screenshots: scenario setup, module configuration, errors

Your variable value is plain text, it should look like:

You can use this syntax:
{{first(shuffle(6.array))}}

Or drag/click the functions in this window:

Cheers,
Henk

Hi,
Looking at your setup screenshots, the issue is clear:
You typed first(shuffle(…)) manually as plain text in the Variable value field. Because it isn’t mapped using Make’s built-in function panel, Make treats it as a literal string and outputs the raw text into your email.
How to fix this:
Open your Tools (Set variable) module.
Clear the Variable value field completely.
Do not type the words first or shuffle manually using your keyboard.
Click inside the field to open the mapping box, go to the Array functions tab (the list icon at the top), and click on first.
Inside the first() parenthesis, select shuffle from the same function tab.
Pass your array (4. Array) inside shuffle(…).
When mapped correctly, first and shuffle will show up as colored function pills/blocks rather than plain text, and Make will correctly evaluate the random quote.

The pills/blocks must be code, next job is extract only 2nd element, the 3rd and 4th shot puzzle me- why does the bundles become {0’“”} - where does the naught come from?

0 is the first item from the array, can you show how you are mapping it in the email module?

So the tools module makes the variable into an array of two item And I need another variable to display only the second item?

No, you do not need another variable. If the Set variable output is a two-item array, map that array directly into the email field and use get(your_array; 2). Replace your_array by clicking the mapped array output from the Tools module. In Make’s get() function, array positions start at 1, so 2 returns the second item. The official documentation is here: General functions - Help Center

Hi I have created a public scenario that should be close to what you are trying to build - a random generated quote sent to an email based on a pool of quotes from Google Sheet

Random Quote to Email

I hope this helps.

What the scenario does:

  1. Pulls the quotes from Google Sheet. We can use Search Rows instead of Watch New Rows, however, I wanted to build it as close to what you built
  2. Bundle all the quotes to an Array Aggregator. The Google Sheets will return each of the quote as a separate bundle. Putting it in an Aggregator bundles them to a single array.
  3. Transforms the data and selects a single quote. This is where the first(shuffle()) function gets into action
  4. Send the Quote to Gmail. Insert the quote inside the Gmail module to send it as an email

Here are my outputs:

Here are 2 screenshots which I consider to be important on your case:

If you still want to go into details, feel free to duplicate the public scenario below.

:right_arrow: :right_arrow: Random Quote to Email

You have made a better output by utilizing a different technique of extracting the variable, Beta 'cause it wasn’t an array which would mean you had to use a get function ps risky To leave behind your email

You’re right. I’ll update the scenario to hide my email

Thank you