SOLVED: How to show 0 and not blank for a SUM in Schedule an API Workflow?

In a nutshell, my problem is I need a SUM to show 0 and not blank in an API Workflow on a list.

In my application I have different clients (which are Partners in my DB) and I want to send each a weekly email that summarizes their weekly sales and other data. For this, I´m using a Schedule an API Workflow on a list. So far so good.

The thing is that for the total sales for the week, I´m using a SUM operator and when there are no sales for the week, this shows as empty instead of 0 on the email, which looks weird since other fields that are counts do show 0. I know this is Bubble´s intended behavior. See screenshot below.

image

If this were a normal text field or a RG, I would simply do a conditional that when the list I´m summing on is empty, to show 0 instead. However I can´t find a way to do this on the Schedule API Workflow.

I´ve tried to use the Only When box at the bottom of the API workflow as I would use a conditional in a text element to make the parameter I want to show 0.

image

The problem is that when setting the condition by using the box, I don´t get a variable called This Partner that I do get when setting the parameters in the API Workflow.

image

This is very hard to explain and I hope someone can help me out.

I often add zero to dynamic values, to make the 0 appear. Perhaps that will work here?

can you elaborate further :grinning:

Here’s a quick example:

07%20PM

In this case, if counter is empty, it will still show a 0. However, if I remove the + 0, it shows up blank.

9 Likes

You sir are a total genius! You solved my problem! Thank you!

brilliant