Looking up a field using a recordset
-
Hi CodePeople, in an earlier thread you wrote the following:
If you want get a row based on the option selected in a DropDown field, I recommend you to use a RecordSet DS field to read the CSV file, and then, you can walk through the records as part of the equation.
For example, assuming that CSV file includes the columns: column_a, column_b, and column_c, and you want get the record whose column_b matchs with the option selected in the DropDown field fieldname1, and the Recordset DS field is the fieldname2, the equation would be similar to:
(function(){ var records = fieldname2, row; foreach(var i in records) { if(records[i]['column_b'] == fieldname1) { row = records[i]; break; } } /** USE THE row VARIABLE IN THE EQUATION **/ } })()
Now the dropdown field I’m using is also a DS field. In this case, would I replace the DS field with the DS Recordset, or would this require the following elements..
DS Dropdown (fieldname1)
DS Recordset (fieldname2)
Calculated Field (let’s say fieldname3) to insert the code above?Thanks for clarifying.
- The topic ‘Looking up a field using a recordset’ is closed to new replies.