Hello,
You are merging different concepts, the piece of code in your ticket is for accessing to the recods in a recordset field through an equation.
About the DropDown DS fields the process is the same, the DropDown DS fields are similar to the DropDown fields, the unique difference is the source of data to populate the field, but if you want to get the record (or row) corresponding to the choice selected in the DropDown DS field, the equation would be the same.
Best regards.
Hi CodePeople, thanks for helping.
I understand exactly what you’re saying and I’m trying it and it still doesn’t work. I’ll attach screenshots.
https://postimg.org/image/ddn4ugct1/
https://postimg.org/image/v41kuvonr/
https://postimg.org/image/ufsqbxpxz/
In order…
1.) DS Dropdown
2.) DS Recordset
3.) Output field (Calculated field)
Now when I choose a choice from column_a in fieldname43, it should also return column_c in fieldname87
I’m importing the same CSV in both fields.
Best Regards,
Chad
-
This reply was modified 9 years, 2 months ago by
chadtesting.
-
This reply was modified 9 years, 2 months ago by
chadtesting.
-
This reply was modified 9 years, 2 months ago by
chadtesting.
-
This reply was modified 9 years, 2 months ago by
chadtesting.
-
This reply was modified 9 years, 2 months ago by
chadtesting.
Hello,
I’m sorry, but you have not understood how the “DS” fields work, your records in the recordset do not include the columns: column_a, column_b, etc. in your case the columns are: 0, 1, 2, 3
Furthermore, the fieldname87 is a recordset field, you are not returning anything in this field, in reality you want to return the value in the fieldname88 that is the calculated field, so, the equation would be:
(function(){
var records = fieldname87;
foreach(var i in records)
{
if(records[i][1] == fieldname43)
{
return records[i][3];
}
}
}
})()
I’m sorry, but I can’t continue developing your project, ticket to ticket (I’ve replied to 68 of your tickets).
If you need help implementing your particular project, you should hire a custom coding service.
Best regards.
Hi CodePeople,
Well on the bright side, it seems to be a quiet day on the forums!
I am definitely interested in learning how the Recordset DS fields work within your plugin, so if there are examples I’m missing that will help me solve this problem myself, I’d be happy to research it. As it stands, I would have no way to know whether the plugin interprets csv columns as ‘column_a’ or [0]. I was just taking you at your word.
This still isn’t resolved however. Is it possible that the foreach is syntactically problematic? When I run it through a delinter, it seems to have a problem with the following line:
foreach(var i in records)
I am executing the code exactly as described above.
Best Regards,
Chad.
Hello,
My apologies, totally my fault, in javascript does not exists “foreach”, but I pass all the day implementing in different programming languages, and sometimes my brain betrays me, the correct code would be:
(function(){
var records = fieldname87;
for(var i in records)
{
if(records[i][1] == fieldname43)
{
return records[i][3];
}
}
}
})()
The CSV files can be defined with headlines as the first row, or not. If you have defined a headline in the CSV file, for example with the name of columns: column_a, column_b, column_c, the comparison would be: records[i]['column_b'] == fieldname43, but if the CSV file does not includes a headline row, the columns would be a numeric index starting in zero: 0, 1, 2, and the comparison would be: records[i][1] == fieldname43
Best regards.
Hello,
Please, include the link to the public web page where the form is, or I cannot check your formulas.
Best regards.
Hi CodePeople,
http://www.futureu.ca
The code is on pg6. I can give you back end access if needed.
Thank you
Hello,
Yes please, don’t make check all tickets to search the URLs and accesses.
Thanks
OK the form is ready. [CP_CALCULATED_FIELDS id=”7″] The fields start near the bottom at fieldname43.
Use the following images for reference:
https://postimg.org/image/hl0uzv71t/
https://postimg.org/image/75j2izb8v/
I’ve emailed you username/password access.
Best Regards,
Chad.
-
This reply was modified 9 years, 2 months ago by
chadtesting.
-
This reply was modified 9 years, 2 months ago by
chadtesting.
Hello,
The URLs to the images files in the links you sent me are broken.
Best regards.
This is resolved. For all those who may be wondering what the missing piece is, in the DS recordset, all fields you are using need to be highlighted. See below
https://postimg.org/image/bl7ynzodx/
Thank you, CodePeople
-
This reply was modified 9 years, 2 months ago by
chadtesting.
-
This reply was modified 9 years, 2 months ago by
chadtesting.