I'm trying to make a REST Query and the data in the request is not being submitted correctly.
I'm using formatDataAsArray()
to structure the results of another data query into a usable format for the API request:
{
//... all other inputs from my Retool form
"claim_history_table": {{formatDataAsArray(getClaimHistoryRecords.data)}},
}
getClaimHistoryRecords.data
is a SQL query to get specific records. When I hover over it, the records show up correctly. For example, here is the result for claim_history_table
:
However, when I submit the request, the output of formatDataAsArray()
is [object Object]
. See claim_history_table
, in_transit_table
, and stock_location_table
as examples.
{
"request_data": {
"inputs": {
"benchmark_premium": 1600000,
"broker_name": a broker,
"cat_exposure": 0,
"cat_tool": ,
"cat_uw_adjustment": 0,
"cat_value": 0,
"claim_history_table": [object Object],
"claim_history_years": 0,
"commission": 0,
"date_file": 2023-06-12T15:56:02.150-0600,
"est_loss_ratio": 0,
"history_premium_is_known": FALSE,
"in_transit_table": [object Object],[object Object],[object Object],
"inception_date": null,
"insured_name": some name,
"previous_plan_estimated_premium": 0,
"previous_plan_is_renewal": FALSE,
"previous_plan_storage_avg_limit": 0,
"previous_plan_storage_tiv": 0,
"previous_plan_turnover_transit": 0,
"stock_adjustment": -0.25,
"stock_location_table": [object Object],[object Object],[object Object],
"total_turnover_transit": 1220000000,
"transit_adjustment": -0.25,
"underwriter_name": a name
}
},
}
There are no transformers enabled.
Any ideas why this isn't working?