Support » Plugin: Calculated Fields Form » Using .csv dataset

  • Resolved EliteWebServices

    (@elitewebservices)


    I’m using the developer version and need some direction with my next challenge.

    My csv file is setup so that each record is on a row. I would like the user to be able to select a particular row of data and be able to perform some simple calculations on the selected data within the row and display that to the user.

    First off, I need to be able to display the data in a drop down table so the user can select a row. Then, I need to be able to pull out some specific column data to perform calculations and display to the user.

    Any help would be appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @elitewebservices,

    I’ll try to describe the process with an example:

    – Assuming the names of columns in the CSV file are: column_a, column_b, column_c, and you want to display the values of the column_a into a DropDown DS field and implement the equation: column_b+column_c where the column_b and column_c correspond to the row whose column_a was selected through the DropDown DS field:

    – First, insert a RecordSet DS field in the form for reading the CSV file, (I’ll call this field fieldname1)

    – Second, insert the DropDown DS field, and select the “Recordset” option as the datasource, select the fieldname1 as the recordset field, and enter the name of the column you want to use for the choices’ values and texts, in this example the column_a (I’ll call it fieldname2)

    – Third, insert a calculated field in the form with the equation:

    
    (function(){
    var records = fieldname1;
    for(var i in records)
    {
    if(records[i]['column_a'] == fieldname2) return records[i]['column_b']+records[i]['column_c'];
    }
    return '';
    })()
    

    and that’s all.

    If you have additional questions about the commercial versions of the plugin, you should create a ticket in my private website:

    https://cff.dwbooster.com/contact-us

    Best regards.

    My data is formatted in rows, should it be reconfigured for columns per your example? Is there a way to show more than field of data in the drop down?

    Plugin Author codepeople

    (@codepeople)

    Hello @elitewebservices,

    Every row is a record, and a record includes columns. Please, send me the link to the CSV file.

    Best regards.

    I was able to add the csv file to the recordset using a local file but when I tried to move it to a url wordpress says error.

    The file is located at https://www.airsuspensionbook.com/bag-data3.csv

    Please remove this url from the public view after you have evaluated it. Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @elitewebservices,

    I cannot modify your tickets, so, you should remove the URL by yourself.

    I’ve tested your .csv file from my online demo and the file was imported correctly, please, look the screenshot:

    One more time, if you need additional support for the premium features, you should create a ticket in my private website:

    https://cff.dwbooster.com/contact-us

    I cannot continue offering you this kind of support through the WordPress forum.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using .csv dataset’ is closed to new replies.