Dropdown produces 'no data' when adding record into an empty table

I have a table based on a postgresql query.

If the table query returns no records (ie, the table is empty), and I try to add a new record to the table, the fields set as dropdown types return ‘no data’ when trying to make a selection:

If however, the table query contains at least one row of data, and I try to add a new record/row, the dropdown fields do show data to select from based on their value list (as expected):

Note: behaviour is the same if the dropdown fields have a static list or a query as their value list.

1 Like

Hey @gsanders - what the expected behavior here, you’d like to be able to add a row even when the query returns no results?

Meanwhile, could you send over a screenshot for the settings for the dropdown column so I can see the values and labels?

Hi Justin - yes thats right - if the query returns no results, would like to create a newRow entry by adding a record, and then write that newRow entry back to a database table using a write resource.

Here is the current setting for the contract_type field:

But I have also tried entering values as a static list:

No difference.

@gsanders gotcha, makes sense. So my first hunch would have been that if you’re powering the dropdown dynamically with values from your query, if the query isn’t returning any data then your dropdown won’t either. For your hardcoding screenshot - did you also hardcode values for labels? If not can you try doing that too?

Just harcoded the static list into the labels as well as the values - and no difference - still ‘no data’ when the table is empty.

Worth noting too: the query for the dropdown values and labels is a different query than the one used to populate the table, so it does seem as though the problem is related to the table being empty and not anything particularly to do with the source of values or labels for the dropdown.

@gsanders gotcha. I was indeed able to reproduce this on my end - I’ll bring this up to the engineering team and update you when it’s fixed!

1 Like

@justin, any update on this? or any hints for a workaround?

Hey @gsanders! Unfortunately we haven’t been able to prioritize this yet - will update the thread when it’s fixed.

@Justin Any update on this?

It makes dropdown fields on table add views completely unusable unless when there’s no data in the main table. This has got to be a really common use case for a table! The fact that it’s been an issue for 6 months gives me concerns about sticking with retool…

Did anyone find a workaround better than resorting to making separate add forms?


Hey @danperry! Apologies for the delay on getting this fixed, there are a lot of open bugs that need our attention :confused:

Let me try and see if I can get this prioritized this week, stand by

Thanks Justin

@danperry we’ve figured out the issue, but don’t have a fix out yet - someone is working on it!