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

@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?

Thanks,
Dan

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!

@justin any update on this? I’m about to start creating ‘add’ forms for all my tables… but will hold off if it’s going to be resolved anytime soon

@danperry just checking in w/ engineering, stand by

Hey @danperry, I’m Emily, an engineer here at Retool picking this up! Sorry for the delay on this. We’ve got a fix in review now, I’ll post here when it’s live.

Hello @danperry, this should be fixed now. If you reference query results {{ query1.data }}, or values like {{ [1,2,3] }}, they should show up for an empty row! If you reference currentRow or i, those values will not be able to be rendered since we don’t have a currentRow or i for the new row.

Let us know if you have any questions!

2 Likes

@emily @justin

I have a simple state dropdown as such:

It seems like a separate issue for me, but my pre-defined dropdown options do not show up whether there is or there are not any rows in the table.

Please advise.

EDIT: Resolved. Needed to remove the semicolon at the end of the values array despite the field validation passing

@glibt was just going to say that :slight_smile:

Perfectly same matter happens again in retool cloud as of 2022/5/25 or self-hosted retool : 2.89.11(latest) .

I have solved this issue by myself.

if a query doesn't have no return record, table data should be set as "query.dataArray" like below.

But I can't find the query parameter to judge whether there are some return record, so that I use a primary key column of my custom table.

image

2 Likes

@jhoshito
Thank you so much for your solution! It helped me a great deal!

Issue is still happening, when there are rows returned form the data source query the dropdown options are loading fine for new row, and when the data source query returns no results the dropdown has no options.
I tried using dataArray instead of data, which shows the dropdown options like @jhoshito mentioned, but then the table shows an empty row although should be empty.

Any ways to resolve this issue?