OpenAI API Conditions

Hi everyone,

I’m working on integrating the OpenAI API in my Bubble app to analyze sales calls. My goal is to run different prompts based on the Scorecard that the user selects (I have multiple scorecards, each with a different prompt). However, I keep getting a 400 error indicating there’s an issue with the JSON formatting.

Here’s my setup:

  • I have two data types:
    1. Call Data: This includes fields for Call Type, Scorecard, and Transcript.
    2. Prompts: This stores different prompts for each scorecard type.
  • I’m trying to dynamically pull the relevant prompt from the Prompts data type based on the selected Scorecard and send it in the API call. Despite multiple attempts, I’m unable to get the JSON to format correctly with the dynamic data, resulting in the 400 error.

Does anyone have experience with setting up conditional prompts in an API call or dynamically referencing data like this in the API Connector? Any tips or examples would be greatly appreciated!

Thanks in advance for any help!

This topic was automatically closed after 70 days. New replies are no longer allowed.