Minor breaking change discovered

When working with an object of array query result, if you did not include the array index, Retool would assume the first element.

Take this query:

update [dbo].[invoices]  set 
 [status_id] = {{status_id}}, 
 [po_number] = {{txtPONumber.value}}, 
...
 [ship_type_id] ={{selShipType.value}} 
 where [invoice_id] = {{qryInvoicesSelect.data.invoice_id}}

qryInvoicesSelect.data.invoice_id only every has a single result which represents the current invoice being edited. qryInvoicesSelect.data.invoice_id would always return the first, and only, element. That just changed and an invalid string error is the result.

I now have to specify the index like so: qryInvoicesSelect.data.invoice_id[0]

Now this was bad practice on my part and I only have a few places in older apps that do this. And it probably should not have never worked in the first place. So on me at least partly, but it still broke a client's app today.

1 Like

so thats what happened!! man thanks for caring to figure out what was going on, I just figured I did something dumb and had to go back and add an index for some random reason. I wasn't sure if my workflow result or query result was different or why, turns out neither technically i guess heh (other than the poor design choice club you and me are apparently President and CEO of :joy:)

2 Likes

Hi @bradlymathews and @bobthebear,

I'm sorry about the regression! Can you clarify what resource you're using? Is it postgresql or some other type of db?

Ahh, should have mentioned that. This is an Azure SQL Query.

@bradlymathews Thanks for the info! I guess the resource type on Retool that you're using for Azure SQL is "Microsoft SQL" right? Just checking, do you have prepared statements enabled or disabled for the resource?

@bobthebear Can you share your Retool resource type as well?

I guess the resource type on Retool that you're using for Azure SQL is "Microsoft SQL" right?

Correct

The option in unchecked.

Hi @bradlymathews and @bobthebear, we can reproduce this change and are looking into exactly what caused this change. We likely won't revert back to the old behavior as the new behavior is technically more correct.

1 Like

Hi Anthony,

I'm very interested in the outcome of your investigation, since I ran into exactly the same issue where our production environment suddenly stopped working.

Do you have an update for us?

Kind regards