Skip to main content
Known Participant
November 15, 2022
Answered

Dropdown selection changes email

  • November 15, 2022
  • 1 reply
  • 1743 views

Hello,

I have a checking in form that when submitted (depending of dropdown selections) auto fills an email with part descriptions and part numbers, this is working fine. I am updating it for other reasons but I was wondering if it is possible to have the email auto populate with different part numbers depending on the selection of part made in a dropdown? 

So if part 1 is selected (screen) then part number for selection 2 (harness) changes?

 

On top of this is it possible that if the screen and harness are missing from the machine can Adobe search part of the serial number of the machine to identify which screen and harness it should have?

 

Hopefully that makes sense!

 

Thanks

 

This topic has been closed for replies.
Correct answer try67

Sorry, yes each serial number will have 3 letters that are the year it was made but changes may only occur every 3 years. so ABC, DEF, GHI will require one part number and the others will require a different one


I recommend looking up some information about boolean operators and logical conditions in general, and in JS in particular. In this specific scenario the code would be something like this:

 

var c1 = /ABC/.test(this.getField("Text1").valueAsString);
var c2 = /DEF/.test(this.getField("Text1").valueAsString);
var c3 = /GHI/.test(this.getField("Text1").valueAsString);
var c4 = this.getField("Dropdown1").valueAsString=="No";
if ((c1 || c2 || c3) && c4) emailBody += "...";

 

1 reply

John CorfAuthor
Known Participant
November 15, 2022

I can appreciate that this doesnt work but something like this?

 

if (this.getField("2").valueAsString=="C1000" + this.getField("6").valueAsString=="No")
emailBody += "\nC1000                               700...";

 

if (this.getField("2").valueAsString=="NT03" + this.getField("6").valueAsString=="No")
emailBody += "\nNT03                               701...";

try67
Community Expert
Community Expert
November 15, 2022

Use "&&" instead of "+".

John CorfAuthor
Known Participant
November 15, 2022

Wow it really was as simple as that! Thank you very much!