Dash DataTable style column values based on a different columns condition

Hi

I use the following code to format some columns in a datatable with a $ symbol.
columns = [{‘id’: c, ‘type’: ‘numeric’, ‘format’: {‘locale’: {‘symbol’: [’$’, ‘’]}, ‘specifier’: ‘$,.2f’}} for c in df.iloc[:,-8:-9].columns]

I have been trying to add a condition to the columns that if another column has a certain word that the symbol should be {‘id’: c, ‘type’: ‘numeric’, ‘format’: {‘locale’: {‘symbol’: [‘US$’, ‘’]}, ‘specifier’: ‘$,.2f’}}otherwise the rest of the column should just have the symbol $

I thought this would work but didn’t - the error I get Cannot read property ‘toString’ of undefined

[[{‘if’: {‘column_id’ : ‘column_to_query’, ‘filter_query’:’{‘column_to_query} contains “US”’}, ‘id’: c,‘type’: ‘numeric’, ‘format’: {‘locale’: {‘symbol’: [‘US$’, ‘’]}, ‘specifier’: ‘$,.0f’}}]+[{ ‘id’: c,‘type’: ‘numeric’, ‘format’: {‘locale’: {‘symbol’: [’$’, ‘’]}, ‘specifier’: ‘$,.0f’}}] for c in df.iloc[:,-8:-9].columns]

Can we do if queries on column or do I need to put this query under something else?