Replace textbox with dropdown in feedback form and still save to Data table

Hi
So for my feedback form I want in the form section “Technician name” to be a drop box where the user can select a name and when they press submit all the data will be saved to the data table including the dropbox selected form. In simple I want to replace the text box that makes the user enter the name and replace that with a dropdown menu where they can select a name and it will still save to the server

My Anvil app can be found here:
https://anvil.works/build#clone:7ELZCRSU5W3GRS5E=QBHZEFFRFB7SWTTAWSTGLR75

I’d like to make some friendly suggestions that might lead you getting better help with this question.

  • Instead of sharing a large app and expecting others to dig around until they think they’ve found section you are referring to, perhaps it would be better to reduce the core issue to a simple example app and share that app here. You want to try and make it as easy as possible for others to jump in and help with the core issue. I looked for a form called “Technician name”, and when I couldn’t find it, I gave up.

  • It is always a good idea to explicitly demonstrate what you have tried. You can demonstrate this best by showing a snippet of code. If there is an error, show that too. If the app is simply behaving in a way that you didn’t expect, just explain that as best you can.

The quality of the answer is usually proportional to the quality of the question.

I’m certainly happy to help further if you can improve the question a bit.

1 Like

I meant the form “ReportJob”

This is a simpler version of the app:
https://anvil.works/build#clone:LJ2V4WQLR4GM5JNV=ZXWHXJCDZZV2OQFTT5YZAMDI

What I have tried is replacing the text box with a drop down but I keep getting errors that say it is not defined when I have defined it. This is the version of the app where I tried to change the text box to a dropbox:

https://anvil.works/build#clone:KXDSYRV5MYDCHC5E=XGY35HFTITOSSRWMRTEP6KTO

Please paste in the exact error you are getting, including the line it occurs on, and let us know how to reproduce it (click this, click that, etc).

Note that when I ran the app it crashed immediately on start up for an unrelated reason (I think you need to make sure that there is a start-up form).

If it helps, it seems like you may be trying to retrieve the text property of a dropdown. Instead you would want the selected value property.

Ok. How do I select the value property?
To get the errors that I am getting. Open this Anvil Link: https://anvil.works/build#clone:SGR4OIQ456LHJ32H=ZW5WDJY34WCSCHSMEPQZMLMW

1.Go to run mode
2. In run mode using the side navigation menu press the tab that says ‘Jobs’
3. Then press “Report a job”
4. Fill in the fields and when you press submit you get an error

The error i get is:
AttributeError: ‘DropDown’ object has no attribute ‘text’ at [ReportJob, line 17](javascript:void(0))

The selected text of a dropdown component is in the selected value property. If you put a dot after the dropdown component in code, the autocomplete will show you the available options.

2 Likes

Thanks it works now.