Error Handling: Missing 'text' Parameter in API Request

Hello everyone, the question must have been raised many times but I’m lost. It seems very simple but I don’t understand why it doesn’t return the text in response. Instead, I get the error "BundleValidationError
Validation failed for 1 parameter(s).
Missing value of required parameter ‘text’."

Hi @Frederic_Nieto and welcome to the Make Community!

I’m not sure exactly why this is happening. However, if you’re willing to share your blueprint here (or sending it to me by private message if you don’t want it available publicly), I can test it to see what’s happening.

L

scenario.blueprint.json (19.5 KB)

Here is the blueprint. I tested it by replacing the HTTP module with a specific OpenAI module, but it’s exactly the same structure and the same issue. I only modified the OpenAI key in the blueprint. When I target Data - Output - Content - Text, it’s empty and it causes an error on my Telegram module.

Hey @Frederic_Nieto,

In Data.output.content.text, both output and content are arrays and what you’re looking at are I believe the last element in the output array. What you map in as input to your module is actually the first element of output, whose content.text could actually not contain anything at all.

Best way to confirm is to look at the HTTP output directly and expanding data, the first output array and output’s first content array and see if text is blank there.

Hope that helps!

Thanks, I solved the problem with: “{{get(13; “data.output[2].content[1].text”)}}”

3 Likes

Actually, it’s not completely fixed. The output table has a number of rows that changes each time, the text field is always in its last row, do you know how to adapt this line {{get(13; "data.output[2].content[1].text")}} using the last function?

Maybe, instead of “2” you can try using a length() function on the output array and that should always give you the last element of output? So if the length of the array is 4 then you’ll get output[4].

1 Like

Smart !!! Thank you.