Welcome to the Make community!
When you have multiple bundles and want just one item, you can use an Array Aggregator first to combine them into an array, then use the shuffle-first functions.
If you already have an array, then just use the shuffle-first functions directly. You can put this in a Set Variable module if you need a module to put these functions in.
{{ first(shuffle(array)) }}
Example
Here is an example of how your scenario could look like:
This is just an example. Your final solution may or may not look like this depending on your requirements and actual data.
Module Export - quick import into your scenario
You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.
-
Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:
-
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.
-
Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.
JSON module export — paste this directly in your scenario
{"subflows":[{"flow":[{"id":47,"module":"json:ParseJSON","version":1,"parameters":{"type":""},"mapper":{"json":"{ \"topics\": [\n\n\"topic 1\",\n\"topic 2\",\n\"topic 3\",\n\"topic 4\",\n\"topic 5\"\n\n]}"},"metadata":{"designer":{"x":-16,"y":-2138,"name":"Topics Array"},"parameters":[{"name":"type","type":"udt","label":"Data structure"}]}},{"id":48,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"topic","scope":"roundtrip","value":"{{first(shuffle(47.topics))}}"},"metadata":{"designer":{"x":229,"y":-2137,"name":"Get Random Topic"}}}]}],"metadata":{"version":1}}
Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?
Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —
Getting Started
- Help Centre | Tutorials – Make “Manual” - search for help here first
- Make Academy – Basics 101: Learn Make properly to get your money’s worth
Help Centre Basics
- Mapping – What is mapping? What can I map?
- Mapping with arrays – How to map items in an array
- Aggregate an array for mapping complex fields
- Date Format: tokens for
parseDate
| tokens forformatDate
- HTTP modules – Make a request, Get (download) a file
- Webhooks – Error Handling, Responding to webhooks
Articles & Videos
- Router Magic Formula - YouTube
- Error Handlers in Make - YouTube playlist
- Getting started with OpenAI - How to setup and use OpenAI (ChatGPT) in Make
- Text Parser module - Use pattern matching to extract the text you want
- Webhooks – Make Academy – tutorial on how to use Webhooks
Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!
— @samliew