Getting dynamic data into my API properly

I have built an API that can read hard-coded JSON body data, but when I try to get it to read dynamic data, the API returns blank values. I have been trying to debug this forEVER. the API is running correctly. The workflow IS running. The data field ids DO match. The only thing I can think of is that the Bubble data just doesn’t translate to JSON. I have tried using the “formatted as JSON-safe” and still get empty responses.
So, for example, if the JSON body looks like this it works just fine:
{
“userId”: “test123”,
“projectionYears”: 5,
“accounts”: [
{
“accountId”: “test1”,
“accountName”: “Test Account”,
“accountType”: “depository”,
“currentBalance”: 5000,
“growthRate”: 2,
“interestRate”: 0,
“monthlyDeposit”: 500,
“monthlyPayment”: 0,
“userId”: “test123”
},

{
“accountId”: “test2”,
“accountName”: “Test Account” 2,
“accountType”: “credit”,
“currentBalance”: -500,
“growthRate”: 0,
“interestRate”: 18.5,
“monthlyDeposit”: 0,
“monthlyPayment”: 50,
“userId”: “test123”
}
]
}

BUT, if I try to use dynamic data like this:
{

“userId”: “test123”,

“projectionYears”: <Input Years into Future’s value:converted to number:default value 5>, “accounts”:

}

or like this:
{ “userId”: “test123”,

“projectionYears”: <Input Years into Future’s value:converted to number:default value 5>, “accounts”: [

{ “accountId”: <Search for Accounts_flats:first item’s accountId>,

“accountName”: <Search for Accounts_flats:first item’s accountName>,

“accountType”: <Search for Accounts_flats:first item’s accountType>,

“currentBalance”: <Search for Accounts_flats:first item’s currentBalance>,

“growthRate”: <Search for Accounts_flats:first item’s growthRate>,

“interestRate”: <Search for Accounts_flats:first item’s interestRate>,

“monthlyDeposit”: <Search for Accounts_flats:first item’s monthlyDeposit>,

“monthlyPayment”: <Search for Accounts_flats:first item’s monthlyPayment>,

“userId”: “test123”

}

]

}

I get empty data back from the API.
Here is a screenshot of one of my many attempts:

No red text or error message. The API runs and my results fields populate in my database. They just populate with empty cells. Lots and lots of empty results. YES, I have unchecked ‘private’ for all the keys.

You are trying to use dynamic tag that can be used in API Connector directly. If you choose to configure your JSON directly in this box (in your screenshot), you need to encode your JSON correctly.For example:

"accountid":Search for account_flats:first item's account ID:format as json-safe

In this example, you are usin :format as json-safe, this will add surrounding double-quotes. But you could choose to set:

"accountid":"Search for account_flats:first item's account ID"

Instead and this will work too (if there’s nothing in the ID that could break the JSON).

But you could instead put your JSON into API connector, and there do

"account_id":"<account_ID>"

At this moment, this is used as a placeholder and in the action, you will see (if you unset private checkbox in API connector) a field to set the account id using just Do a search for…