How to Use Variables in ChatGPT Prompts

If you're using ChatGPT to speed up your productivity, it's critical that you learn how to use variables in your prompts.

Variables allow you to write the perfect prompt once, and then reuse it over and over while simply swapping out the topic (or whatever other variable that's changing).

Let's take the following prompt for example:

Write me a Blog Title for an article on tree frogs. It should be engaging, and no more than 60 characters.

Looks like a solid prompt! But it's not exactly "reusable" unless all you're writing about is tree frogs.

Instead let's create a variable, [topic], and upgrade this prompt 🚀

Write me a Blog Title for an article on [topic]. It should be engaging, and no more than 60 characters.

[topic] = tree frogs

Now ChatGPT knows to look for the topic at the end of your prompt. Works like a charm:


How to Manage ChatGPT Prompts with Variables

Variables are great because they help you reuse the same prompt template over and over, while just swapping out one or two pieces of information.

But things do get messy if you're managing all of this in a notepad file or Google Sheet. You'll end up with a bunch of messy placeholder values for variables, which can get confusing!

That's why we designed PromptFolder with variables in mind. When you create a prompt, bracketed variables are color coded so it's clear what information needs to be filled in to complete a prompt.

More importantly, when you're doing running a prompt and come back to it later the variable's value will be cleared. This is super helpful if you're frequently using variables in ChatGPT:

No more wasting time figuring what text needs to be deleted from a prompt before you can start using it!

Give it a try yourself with this prompt:

ChatGPT Prompt: Blog Post Outline Generator

How Do You Format Variables in ChatGPT Prompts?

My favorite way to format variables in a ChatGPT prompt is by enclosing them in brackets [like this].

But ChatGPT is smart! You could use a colon, parentheses, and pretty much anything else that "makes sense." I'd just recommend staying consistent.

Can You Use Multiple Variables in ChatGPT Prompts?

Yes, ChatGPT is perfectly capable of understanding multiple variables. PromptFolder supports multiple variables in your prompts as well.