✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐍Plotly, Coiled CEOs Discuss Partnering & ML Experts show us how Dash + Dask apps work Register for the Webinar.

DataTable Copy Paste From Excel to DataTable

Hello Everybody,

I’m having an issue with the DataTable. I have a dash app hosted on a flask web app where users can copy/paste from Excel/CSV file to the datatable. I have dropdowns as well.

The issue I’m having is that it accepts values that aren’t from the dropdown selection. It may not show up on the datatable UI on the web page but when I check the backend, the wrong values not part of the drop-down have been saved to the database. Is there a setting that will reject any wrong values that don’t match the dropdowns or is there a workaround for this? I have the below but it doesn’t reject wrong values, it allows it to be saved:

{‘id’: ‘commodity’, ‘name’: ‘Commodity’, ‘type’: ‘text’, ‘presentation’: ‘dropdown’, ‘on_change’: { ‘action’: ‘coerce’, ‘failure’: ‘reject’ }},