1
0 Comments

Just Shipped: Even More Powerful Conditionals with "Else" Statements in Doxy

Hey Indie Hackers!

Excited to share another update to Doxy - our tool that turns Google Docs templates into automated PDF generators. Just a few weeks ago, we launched conditional rendering, and today, we're taking it up a notch with a feature many of you have asked for: else statements.

The Problem (and Our Solution)

Previously, conditional rendering in Doxy allowed you to show or hide sections of your document based on a boolean variable . This was great for many scenarios, but what if you wanted to display alternative content when a condition wasn't met? That's where the new else functionality comes in.

How It Works

We've kept the syntax intuitive and consistent with the existing conditional rendering:

#if:isPremium# Welcome to our premium service! You have access to all features. #else:isPremium# Consider upgrading to our premium plan for additional benefits. #endif:isPremium#

As you can see:

• When isPremium is true, the first message is shown.

• When `isPremium` is false, the content after #else:isPremium# is displayed instead.

• The #else statement must use the same variable name as its corresponding #if statement .

Why This Matters (The Benefits)

This seemingly small addition unlocks significant flexibility:

Provide Alternatives, Not Just Omissions: Instead of having blank spaces when a condition is false, you can now present relevant alternative information.

Streamlined Templates: Create more versatile templates that can handle multiple scenarios within a single document.

Enhanced User Experience: Deliver more personalized content that speaks directly to each recipient's specific situation.

Reduced Template Maintenance: You might be able to consolidate different template variations into a single, more dynamic one.

Real-World Use Cases

The possibilities are vast! Here are a few examples:

Pricing Communications

Membership Status

Regional Content

Payment Status

Try It Out!

The else functionality is live right now for all Doxy users. Simply update your Google Docs templates with the new syntax, and you can immediately start taking advantage of this enhanced conditional rendering in all your document generation workflows.

We're constantly listening to your feedback and working to make Doxy even more powerful and user-friendly. Let us know what you think of this new feature!

Happy automating!

Mat Fish

https://www.doxy.ink

posted toAvatar for product Doxy
Doxy