Cannot get default value to work for a select component

I have a select component in a form, which uses a JavaScript transformer as its data source. The transformer returns an array of objects, each of which contains a "currency" and "funding_amount" key. The transformer is triggered anytime a different row is selected in a table.

I have set up mapped options and a default value for the select component, which works just fine. However, the moment I change the "form data key" of the component from an empty value to a string ("funding_amount", which corresponds to the name of a DB column), the default value completely stops working: the select component is blank no matter which table row the user clicks on, and the console throws an error "Cannot read properties of null (reading 'currency')".

Again, this only happens if the "form data key" is set to a non-empty value. Any thoughts on why this might be? Thank you!

Hey @jaypinho!

Sorry for the delay in getting back to you here, we just got back from the Thanksgiving holiday break and are trying our best to catch up :sweat_smile:


What is your default value currently set to? When you change your table row and check it transformer value in the State tab of the left panel, is the value correct/what you expect?

No problem!

Right now the default value for the select component is set to:

{{ parseInt(table1.selectedRow.data.funding_amount) }}

On further investigation, when I populate the form data key, the select component value DOES change to the correct value every time I change my table row, but then immediately switches back to blank/empty.

Based on the console, it looks like this is happening because it's triggering another query (editFundingRound), even though that query is set to "Run query only when manually triggered".

Is there anything at all that can cause a "Run query only when manually triggered" query to run (other than by being manually triggered)? I can't figure out why this is running at all.

Ooh that's helpful!

We can try to see what is triggering this query.

One way to do this would be to open up your debug console in your app (little bug icon in the bottom right) and then the State tab.

If you click through your components/queries, do you see anything that might trigger the editFundingRound query?

If you can't track it down, I'd be happy to step in to poke around!

For example, my nextButton1 controls the steppedContainer1 and depends on 4 other components/queries (seen at the bottom right of the debug console > State tab)