Returning only a few fields of a thing via an API call

Thanks for the reply, @akhilpuri2003. See my comments below…

That’s one of the things I already tried. Unfortunately, it breaks when a field has no value, because it omits the field entirely instead of outputting an “empty” value for the field.

In the example below, for instance, no image has yet been uploaded for Product FOUR and Product FIVE.

{
    "status": "success",
    "response": {
        "title": [
            "Product FIVE",
            "Product FOUR",
            "Zen Garden"
        ],
        "description": [
            "This is the description of product 5.",
            "This is the description of product 4.",
            "This is the description of the Zen Garden."
        ],
        "image": [
            "//s3.amazonaws.com/appforest_uf/f1564373124819x142177157546424800/zen-garden.jpg"
        ]
    }
}

As a result, that solution will not work for me. I then thought that this cool new Bubble feature (which, as of this writing, has not yet been formally announced but is available in the editor) would make this super simple. And it does…

[{
   "title" : "Product FIVE",
   "description" : "This is the description of product 5.",
   "image" : ""
},
{
   "title" : "Product FOUR",
   "description" : "This is the description of product 4.",
   "image" : ""
},
{
   "title" : "Zen Garden",
   "description" : "This is the description of the Zen Garden.",
   "image" : "//s3.amazonaws.com/appforest_uf/f1564373124819x142177157546424800/zen-garden.jpg"
}]

The problem with this approach is that the Return as plain text option must be enabled, which means the endpoint does not return JSON. :frowning_face:

Depending on where the content’s being consumed, though, it might be as simple as applying JSON.parse()to the result.

Anyway, still no ideal solution, but this approach is closer to what I need. If you come up with a better way, please post back to this thread.

-Steve