Hello @chris007
I’ll try to describe the process with a hypothetical example. Assuming you have the RecordSet DS field fieldname1 where each record contains two properties, column_a, and column_b. column_a is used with the DropDown DS field (fieldname2) choices’ texts and values, and column_b contains the URL to the image file. Finally, you want to display the image corresponding to the choice selected by the user in the DropDown DS field.
In this case, I’ll use a calculated field as an auxiliary. You can hide it by ticking a checkbox in its settings.
Insert a calculated field in the form, I’ll call it fieldname3, and enter the following equation:
(function(){
let records = fieldname1;
for(let i in records) {
if(records[i]['column_a'] == fieldname2) return '<img src="+records[i]['column_b']+">';
}
return '';
})()
The previous equation walks the record-set (fieldname1) records, and returns an IMG tag where the SRC attribute corresponds to the column_b property whose column_a matches the value selected by the user in the Dropdown DS field (column_a).
Finally, insert an “HTML Content” field in the form where displaying the image, and enter the following DIV tag as its content:
<div data-cff-field="fieldname3"></div>
The data-cff-field attribute indicates the plugin the field whose value you want to display in the tag.
Please note we are not allowed to support any customers in these forums, and the DS fields are distributed with the Developer and Platinum plugin versions.
For pro or commercial product support please contact us directly on our site. This includes any pre-sales topics as well.
Commercial products are not supported in these forums. We will happily answer this and any other questions you can have on our own site.
Thank you.