View Single Post
  #2  
Old April 21st, 2022, 04:07 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 957
Default Re: Issue with blank or no selection

Would this work?
Code:
var externalDF = new ExternalDataFileEx("Competitor-ExDF.xlsx", "Excel");
var unique = function (value, index, self) {
  return value ? self.indexOf(value) === index : false;
};
var getResource = function (value) {
  var fieldValue = externalDF.GetFieldValue(value, "CompetitorImage");
  return fieldValue ? Resource(fieldValue).content : '';
};
return ["CP-Product-1-A", "CP-Product-1-B", "CP-Product-1-C"]
  .map(Field)
  .filter(unique)
  .map(getResource)
  .filter(String)
  .join(' ');
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote