Forum Academy Marketplace Showcase Pricing Features

"Manually enter API response" isn't sticking

In my API call, I am trying to set a Parameter to only give me back data WITHOUT a category.

So, I put in the correct Parameter and leave it blank… Mark “Allow blank”.

Data response:
Screen Shot 2021-12-15 at 8.27.33 AM

Ugh, this is wrong… It gives me back ALL data, blank categories and data with categories!

My first thought was it’s because I set “Optional”. So the first thing I did was remove “Optional”… Thinking I want to force it to accept the empty category parameter. In other words, I ONLY want data returned to me without a category (so only 1 record).

So, I remove “Optional” and reinitialize…

Nope. Now it won’t initialize. It says it’s mandatory. But that’s what I want! I want it to be empty.

Now, here’s the kicker… if I “Manually enter API response”, and manually type in the category to blank… it works.

Screen Shot 2021-12-15 at 8.29.32 AM
Screen Shot 2021-12-15 at 8.30.13 AM

Great! So I can force my API to accept an empty category and only give me back data with an empty category.

The problem is once I go to make the call on my page, even after I “Manually enter API response”, the data goes back to showing me ALL data, including ones that have category.

@nickc How can I force an empty value to be sent in the Parameter field like what I did in the “Manually enter API response”?

Number One,

Maybe to ‘Initialize’, you need to include a value, just so Bubble will know how to map the return data.

When you make the call on your page, if you set the ‘timelogCategories’ to always come from a customState of an element then you can just set conditionals to say ‘when customState is empty’ then don’t show the returned field that shouldn’t be returned.

1 Like

Good suggestions! I’ll try it out. Thank you.

1 Like