DataGrid: Adding a $ sign and retrieving enum values from backend

Hi all. I’m using a Datagrid for the first time. Have two questions please:

  1. What’s the best practice to add a $ to a decimal field?

  2. Can I make a field a dropdown and have it populated by an enum from the backend?

More details in the linked loom:

Loom | Free Screen & Video Recording Software | Loom.

Thanks.

  1. If the currency isn’t changing then just add a static ‘$’ in the formula eg.
    image

  2. I’m not sure if you can access enums (but that would be interesting if someone has a method…). I guess you could create a variable in the backend and send it with the response. But then don’t have access to the list when you are creating a new record.

I would use the Cell Select - set the initial value to the data you are retrieving. Create a variable array [“Hourly”, “Monthly”, etc.] and bind that variable to the options. eg.

1 Like

Thanks @MichaelLovell appreciate the reply. Both these make total sense. Thank you!

@MichaelLovell Trying unsuccessfully to prepend the $ symbol. Tried in two different places without success, see Loom. Any other suggestions please?

Unbind the ‘Display’ field. What you want to bind is the ‘Init value’

1 Like

Worked! You’re a genius. :joy:

Thanks again.

@MichaelLovell It works, but only until I navigate away. User error, or WeWeb bug?

Thanks.

That’s weird. The Weweb team will need to answer that one.

Thanks. I’ll submit a ticket.