Using recordset to fill a field based on dropdown
-
Hi,
I’m making a calculator form that relies on several columns of data stored in a csv. The data relates to states in the USA, and I’ve set up a dropdown using the names of the states to begin the process. How do I then fill other fields with data for the selected state, in order to perform the calculations?
Here’s what I’d like to do:
- User selects their state
- Several hidden fields load data like electricity price, avg kWh usage per month, etc.
- User enters their monthly electricity bill and I can tell them whether it’s higher or lower than the average.
That’s just one example. I can do the math, but I need to know how to populate the fields.
Here’s what I’ve tried so far:
- Imported a CSV for use as recordset with columns named “state” and “elec_price” (fieldname5)
- Set up a dropdown DS field using the recordset, with state populated as values and texts (fieldname 4)
- Tried to set up a “Line Text DS” field to be populated with the elec_price record for the selected state. I input “elec_price” into the “Property for Values” field, and “record[‘state’]==<%fieldname4%>” into the “Condition field. Please tell me what I’m doing wrong.
Just being able to learn how to do this correctly for this one field will allow me to continue to work on getting the math right. Thanks!
Image shows setup of the Line Text DS field:
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Using recordset to fill a field based on dropdown’ is closed to new replies.