Skip to main content
Participating Frequently
June 4, 2024
Question

Hello! Need some help assigning 4 variables to 4 different standard text versions, driven by #1!

  • June 4, 2024
  • 2 replies
  • 297 views

Hello, I have 4 variations of standard text that needs to be generated based on 4 specific selections within my form. 

 

I will need the selection variables to insert in to certain points of the selected text from dropdown #1.

 

Dropdown #1 - will determine which of the 4, standard covenant text templates generates. 

i.e. (DSCR, Consolidated, Ratio, Single) 

 

Dropdown #2 - will determine frequency, (Annual, Quaterly, Monthly) which will be inserted into text.

 

Date #3 - This will need to be inserted into the text. 

 

Dropdown #4 - will determine ratio target, will be inserted into text. 

 

A sample generated text will look like this, 

(This is a test DSCR paragraph, the frequency will be here ____, the date will be here _____, the target will be here ____.) 

 

I went down the route of writing the command for each scenario but this is time consuming and large!

 

Any help is appreciated! 

 

Thank you!

 

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

PDF Automation Station
Community Expert
Community Expert
June 4, 2024

You have to concatenate the text string and the values like this:

var dd1=this.getField("Dropdown1").value;
var dd2=this.getField("Dropdown2").value;
var date=this.getField("Date").value;
var dd4=this.getField("Dropdown4").value;
var text=
"This is a test "+dd1+" paragraph, the frequency will be here "+
dd1+",the date will be here "+
date+" the target will be here "+dd4+".";

 

Change the field names to the actual field names.

Bernd Alheit
Community Expert
Community Expert
June 4, 2024

You can combine the pre-defined text with the values of the fields.