Bug: Retool won't let me use Array.prototype.map() in a Column dropdown 'values' definition

Hi Retool,

I am trying to map an array of simple objects of form:

{
    id: string,
    name: string
}

such that their names are displayed in a dropdown.

I have done this before with other elements using map, per instruction here, but these appear to have stopped working today.

I can confirm that the scripts I am using: {{table.selectedRow.data['field name'].map(val => val.name)}} each evaluate to an array of strings respectively, but I receive the Objects are not valid as react child... error.

Additionally, just to confirm my script was correct. I set up a standalone Dropdown object that accessed query.data[{random index}] as opposed to table.selectedRow, and confirmed that the product of the script was the same as in my table. This dropdown populated with values successfully.

Please investigate at your convenience.
Thanks.

Hey there @roblevy. Can you reply with a screenshot of your property inspector (the left panel) so I can see what the data structure looks like? I’m having trouble understanding it from your post.

Absolutely

Every dropdown should display the names of the Potential Matches for the data entry matching the row indice.

Thanks @roblevy. There are two things I suspect are going on here:

  1. The values that you pass in for a dropdown’s values or labels need to be formatted as an array. If you pass in a single value, you’ll get an error. So you might need to try wrapping your results in [].
  2. There’s a bug that we’re working on that causes phantom errors in column mappers. The React error that you included is not one of these, but just keep this in mind in case you get an error message but things appear to be working.

Let me know if this helps!