Random Variable for Post!?

hello everyone, i am currently creating an autoposter for linkedin. i have a trigger at 7.45 a.m. daily, then a gpt and then linkedin_post and then i receive a corresponding notification via telegram. now the situation is that i give the gpt a fixed topic via prompt, which should now change. the plan is to specify 5 variables with different topics without an external table using set multible variables, from which one is then randomly selected and written to another variable, which I then incorporate into gpt. what is the best/easiest way to do this?

many thanks in advance :slight_smile:

best regards

dennis

Hey Dennis,

you can have the 5 variables inside an array, then use first(shuffle()) to get a random item from that array.

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:
Screenshot 2025-06-13 184705

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.

  1. 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:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. 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

Articles & Videos

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

2 Likes

verry good - many thanks! works fine :slight_smile:

1 Like