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

Hi,

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

2

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?

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?

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?

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.

Nope, that’s not how it works.

1 Like

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.

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.

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.

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.

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.

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

1 Like

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

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

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.

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.

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?

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.

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.

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

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

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.

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.