# \[SOLVED\] Display data based on multiple 'Search for' info

**URL:** <https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382>\
**Category:** Database\
**Created:** [April 9, 2022, 9:27pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382 "2022-04-09T21:27:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 9:27pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/1 "2022-04-09T21:27:25Z")

</div>

Hi,

I am showing the results of how many invoices have been paid, I set the default to £0.00;

![2](https://us1.discourse-cdn.com/bubble/original/3X/e/c/ec8b00fd3d9863330aa6df11e94d894e9f98e525.png)

Then I search for invoices paid (in this case in the last 30 days) and this displays correctly (the default £0.00 is replaced with the correct amount). But, if there are no invoices paid, the default £0.00 is not showing, I see a blank space?

 ![1](https://us1.discourse-cdn.com/bubble/original/3X/0/8/089bb4286269cfe162eef8d7df3865c4b3e99df9.png)

---

<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:** [April 9, 2022, 9:39pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/2 "2022-04-09T21:39:02Z")

</div>

The obvious (and presumably correct) answer is that the condition must still be true… but the text is obviously empty. (unless it’s to do with your other 2 conditions?).

How are you setting the condition?

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 9:44pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/3 "2022-04-09T21:44:49Z")

</div>

When the number 30 is clicked it updated a Text customer state ‘ActiveButton’ with Bttn30.

Then, the total amount displayed shows the invoices paid in last 30 days When `ActiveButton is Bttn30`. I have done the same for the last 90 days and All, `Bttn90`, `BttnAll`.

I did try, `When ActiveButton is Bttn30 invoices is 0` then show £0.00, but no matter how many ways I did this, something wouldn’t work.

Can I not simply say `When text box is empty then show £0.00?`

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [April 9, 2022, 9:51pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/4 "2022-04-09T21:51:52Z")

</div>

I still have the link to your app (that’s me poking around in there), and the problem is you don’t have any conditions that tell the element to display £0.00 when the searches are empty. The default text on the _Appearance_ tab is not going to magically come back because, as Adam said, one of your conditions is still true, but there is nothing to display because the search is empty. You need conditions that explicitly tell the element to show £0.00 when the searches don’t return any results.

> [@darren.james7518](#):
>
> Can I not simply say `When text box is empty then show £0.00?`

Nope, that’s not how it works.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 9:53pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/5 "2022-04-09T21:53:36Z")

</div>

> [@mikeloc](#):
>
> conditions that tell the element to display £0.00 when the searches are empty.

Thanks Mike, Ok I see what you mean, however, I can’t find what conditions to tell the element to display in order to get a result of £0.00 when the searches are empty.

Also, regards to one of the conditions is still true, I did have 3 separate conditions:

```
`When ActiveButton is Bttn30 invoices is 0 then show £0.00.` 
`When ActiveButton is Bttn90 invoices is 0 then show £0.00.` 
`When ActiveButton is BttnAll invoices is 0 then show £0.00.` 

```

I thought this would work because even if one condition is true, I have treated them individually.

---

<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:** [April 9, 2022, 9:54pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/6 "2022-04-09T21:54:29Z")

</div>

> [@darren.james7518](#):
>
> When the number 30 is clicked it updated a Text customer state ‘ActiveButton’ with Bttn30.

Well that explains it then…

What are you expecting/wanting to happen with that condition?

> I did try, `When ActiveButton is Bttn30 invoices is 0` then show £0.00, but no matter how many ways I did this, something wouldn’t work.

I can’t work out what that means?! (Active button is a custom state, no? - so that expression makes no sense at all, unless I’m missing something).

I’m not sure you need any conditionals her at all to be honest… just set the text to display the value (formatted as a number to 2 decimal places). If there are no invoices the value will be 0 anyway…

Or, if you really need to use a conditional, surely the condition should just be if the search is empty then display £0.00, if not then display the value.

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [April 9, 2022, 9:56pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/7 "2022-04-09T21:56:00Z")

</div>

It should be `dashboard's ActiveButton is Bttn30 and Search for Invoices:count is 0`, with the same constraints on the search that you are using in the other conditions.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 9:57pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/8 "2022-04-09T21:57:55Z")

</div>

I did try that. I will set it up again as I had it and as I would have expected it to work so you can see.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 9:59pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/9 "2022-04-09T21:59:25Z")

</div>

> [@adamhholmes](#):
>
> What are you expecting/wanting to happen with that condition?

I suppose the only reason I am using custom states is so that when a user clicks on the number ‘30’, not only will Paid invoices from the last 30 days show, but also the number ‘30’ will change colour. I couldn’t think of any other way to do this without custom states.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:05pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/10 "2022-04-09T22:05:04Z")

</div>

> [@mikeloc](#):
>
> It should be `dashboard's ActiveButton is Bttn30 and Search for Invoices:count is 0`,

Huh, this seems to work now, but I definitely tried that several times before! I will just test this a bit more now to confirm …

Ah, no it doesn’t work. It now **always** shows £0.00 even if there should be data. So to confirm, the below always shows £0.00 even when the invoice count is \>1.

![1](https://us1.discourse-cdn.com/bubble/original/3X/b/d/bd09eaa7f45edaeda5ecd89429b71bd6f412b789.png)

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:11pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/11 "2022-04-09T22:11:27Z")

</div>

> [@adamhholmes](#):
>
> I can’t work out what that means?! (Active button is a custom state, no? - so that expression makes no sense at all, unless I’m missing something).

Sorry @adamhholmes I didn’t make that clear, I meant to say;

`When ActiveButton is Bttn30` and `Search for Invoices Paid in last 30 days:count is 0`, then display £0.00. However, as per my comment above, this doesn’t work because it displays £0.00 all the time.

Using the condition above, the result shows £0.00

![1](https://us1.discourse-cdn.com/bubble/original/3X/c/5/c5683a7b6e9366cb2fae6f6ce3543e1fcc307fbb.png)

But it should show £81.74 as this invoice was paid within last 30 days.

 ![2](https://us1.discourse-cdn.com/bubble/original/3X/3/6/369bcfc54880fbd6afb19e1d7f2ba357718942cf.png)

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:21pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/12 "2022-04-09T22:21:21Z")

</div>

> [@adamhholmes](#):
>
> just set the text to display the value (formatted as a number to 2 decimal places). If there are no invoices the value will be 0 anyway…

I could do that if there were only one result, such as `Search for invoice's Paid in the last 30 days`, but because I have multiple results I have to use separate conditionals (unless I am not understanding correctly).

The only solution I can think of now is to have three separate Text boxes and show/hide each based on what the user wants to see.

---

<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:** [April 9, 2022, 10:28pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/14 "2022-04-09T22:28:30Z")

</div>

> I could do that if there were only one result, such as `Search for invoice's Paid in the last 30 days` , but because I have multiple results I have to use separate conditionals (unless I am not understanding correctly).

I think you’re not understanding correctly… just put the constraints on the search.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:32pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/15 "2022-04-09T22:32:54Z")

</div>

> [@adamhholmes](#):
>
> I think you’re not understanding correctly… just put the constraints on the search.

I have put constraints on the search, but I have 3 conditions to search for (marked on image, sorry a bit messy!). I can’t see how I can add all those conditions to a single search?

 ![1](https://us1.discourse-cdn.com/bubble/original/3X/d/5/d59b96113797e49f345d0d7ad4ac20c1c4dc24e7.png)

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [April 9, 2022, 10:38pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/16 "2022-04-09T22:38:47Z")

</div>

Hmm, it’s odd that the 4th condition seems to be overwriting the 1st one. Just for the heck of it, try moving the 4th condition to the top of the condition list.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:40pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/17 "2022-04-09T22:40:15Z")

</div>

Ok, I will try that. Even more odd is that I just tested have a separate text box which shows/hides for just one of the conditions and even that won’t show £0.00 when there are no invoices.

@mikeloc I moved the 4th condition to the top of the condition list but now that is being over ridden. In other words, the new 1st condition (show £0.00 when there is no data) is not working, I see a blank text box in Preview. This has been the case all evening, whatever I try I either get £0.00 all the time, or a blank result when there should be a figure.

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [April 9, 2022, 10:45pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/18 "2022-04-09T22:45:35Z")

</div>

Oh, wait… try changing the 2nd condition to match the 1st one, but change the end of it to \> 0.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:49pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/19 "2022-04-09T22:49:07Z")

</div>

Good point! I just did that and instead of showing £0.00, it shows ‘no’?

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [April 9, 2022, 10:49pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/20 "2022-04-09T22:49:58Z")

</div>

No, not the text, the condition itself. Put the text back the way you had it, copy the first condition into the field for the second condition, and change the end of the condition to \> 0. Again, the condition, not the text to display.

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [April 9, 2022, 10:54pm UTC](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382/21 "2022-04-09T22:54:21Z")

</div>

Sorry I got that wrong, thanks for re-explaining, I have done this and first signs look good … I see £0.00! Let me check further …

Aggghh! No, same issue, now it ONLY shows £0.00, even when it should show a number.

[Next page](https://forum.bubble.io/t/solved-display-data-based-on-multiple-search-for-info/201382.md?page=2)
