# Conditionally set Text depending on database entry being empty or not (backend) without using the "only when" option

**URL:** <https://forum.bubble.io/t/conditionally-set-text-depending-on-database-entry-being-empty-or-not-backend-without-using-the-only-when-option/305510>\
**Category:** Need help\
**Created:** [February 2, 2024, 1:31pm UTC](https://forum.bubble.io/t/conditionally-set-text-depending-on-database-entry-being-empty-or-not-backend-without-using-the-only-when-option/305510 "2024-02-02T13:31:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hi\_bubble](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@hi\_bubble](https://forum.bubble.io/u/hi_bubble)\
**Post date:** [February 2, 2024, 1:31pm UTC](https://forum.bubble.io/t/conditionally-set-text-depending-on-database-entry-being-empty-or-not-backend-without-using-the-only-when-option/305510/1 "2024-02-02T13:31:02Z")

</div>

Hello,

I was wondering how to set a text depending on a condition that is not being evaluated at the bottom of a workflow but within the workflow (so I don’t have to copy the entire workflow just to check one single condition. The maintenance of this kind of copy&paste is just hard to maintain and no best practice).

**The scenario:**

I am setting the filename of a file in a specific schema within an arbitrary text:

```auto
current date/time_werteinschätzung_<THE CONDITIONAL TEXT>.pdf

```

The conditional text depends on the purpose of creating the file. it can contain either:

- the creators last name
- the name of a company
- a user input string

The workflow itself is already running with an “only when” condition so I would really like to make the evaluation not on the workflow layer but within the arbitrary text.

**Is this even possible?**

Thanks!

Current state:

 ![Bildschirmfoto 2024-02-02 um 2.30.12 PM](https://us1.discourse-cdn.com/bubble/original/3X/f/8/f86ce8b3b8bedd8ad94b26e5f1db5d672eda28ba.jpeg)

---

<div class="post-metadata">

**Author:** ![adamhholmes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adamhholmes/32/100510_2.png) [@adamhholmes](https://forum.bubble.io/u/adamhholmes)\
**Post date:** [February 2, 2024, 1:54pm UTC](https://forum.bubble.io/t/conditionally-set-text-depending-on-database-entry-being-empty-or-not-backend-without-using-the-only-when-option/305510/2 "2024-02-02T13:54:46Z")

</div>

Just use the conditional expression directly in the text box, and use Format as text to define the text to use.

---

<div class="post-metadata">

**Author:** ![hi\_bubble](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@hi\_bubble](https://forum.bubble.io/u/hi_bubble)\
**Post date:** [February 2, 2024, 10:38pm UTC](https://forum.bubble.io/t/conditionally-set-text-depending-on-database-entry-being-empty-or-not-backend-without-using-the-only-when-option/305510/3 "2024-02-02T22:38:08Z")

</div>

Thanks a lot for pointing this out. This was somehow not on my mind. Works perfectly.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 12, 2024, 1:31pm UTC](https://forum.bubble.io/t/conditionally-set-text-depending-on-database-entry-being-empty-or-not-backend-without-using-the-only-when-option/305510/4 "2024-04-12T13:31:34Z")

</div>

Closed on April 12, 2024, 1:31pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
