Title: Access Recordset data in javascript code
Last modified: February 17, 2020

---

# Access Recordset data in javascript code

 *  Resolved [thehun80](https://wordpress.org/support/users/thehun80/)
 * (@thehun80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/)
 * Hello,
 * I successfully imported a dataset via CSV to a recordset and now I want to search
   some values according to a town name that is in the first column.
 * I have tried to use a hidden DS control to filter the data using the condition
 * record[‘Municipio’]==fieldname53
 * but nothing was returned in the field (and it also messed up my dropdown structure
   showing all of them regardless of the fact that I had set their visibility in
   dependency of another dropdown).
 * Is there a way to search/reference these values using javascript in a calculated
   field? or do I have to do an intermediate step adding another DS field and then
   using its output as variable?
 * Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12446941)
 * Hello [@thehun80](https://wordpress.org/support/users/thehun80/)
 * The correct structure for the condition would be:
 *     ```
       record['Municipio']=='<%fieldname53%>'
       ```
   
 * Please, for additional questions about features in the commercial version of 
   the plugin, create a ticket in my private website: [Contact Us](https://cff.dwbooster.com/contact-us)
 * Best regards.
 *  Thread Starter [thehun80](https://wordpress.org/support/users/thehun80/)
 * (@thehun80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12446965)
 * Thanks,
 * which field should I use? As I said the Hidden DS messes up the structure of 
   the form and I don’t know how to reference it directly from a javascript code.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12447020)
 * Hello [@thehun80](https://wordpress.org/support/users/thehun80/)
 * I’m not sure how do you want filtering the records, but yes, you can walk through
   all records of RecordSet DS field from the equation associated to a calculated
   field. Please, visit the following link:
 * [https://cff.dwbooster.com/blog/2019/02/14/ds/#recordset-equations](https://cff.dwbooster.com/blog/2019/02/14/ds/#recordset-equations)
 * Best regards.
 *  Thread Starter [thehun80](https://wordpress.org/support/users/thehun80/)
 * (@thehun80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12447775)
 * Thanks and sorry to bother you again,
 * I followed the instructions in the link but I still seem to be doing something
   wrong because I don’t get any results in the calculated field with this code (
   remains empty):
 *     ```
       (function(){
   
       var records=fieldname55;
   
       for(var i in records)
               {
               if(records[i]['Municipio'] == fieldname53)
                   return records[i]['porc5'];
               }
               return '';
   
       })();
       ```
   
 * I have double-checked that the columns have been imported correctly and that 
   the data I’m looking for contained in fieldname53 is indeed in the CSV
 * [https://i.postimg.cc/q7Sz6FtB/Captura-de-pantalla-2020-02-17-a-las-21-45-37.png](https://i.postimg.cc/q7Sz6FtB/Captura-de-pantalla-2020-02-17-a-las-21-45-37.png)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12447833)
 * Hello [@thehun80](https://wordpress.org/support/users/thehun80/)
 * You must select all options through the “Select Columns” attribute. It is a multi-
   select list, so, the columns must be selected explicitly.
 * Best regards.
 *  Thread Starter [thehun80](https://wordpress.org/support/users/thehun80/)
 * (@thehun80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12447884)
 * Cheers, you’re the best!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Access Recordset data in javascript code’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [thehun80](https://wordpress.org/support/users/thehun80/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/access-recordset-data-in-javascript-code/#post-12447884)
 * Status: resolved