5 variable fields into 4 different paragraphs, command written, which fields need custom calcs?
I am attempting to create a form that has 5 variable selection fields show in referenced spots within a paragraph.
There a 4 paragraphs to choose from in the very first dropdown question.
This is what I have written, but am confused by which fields need custom calculations.
Dropdown3 is the first paragraph driver and the other 5 variable input fields are below.
const frequency = this.getField('Dropdown8').value
const date = this.getField('Date7_af_date').value
const target = this.getField('Text9').value
const calcmonths = this.getField('Text99').value
const periodend = this.getField('Dropdown88').value
// Function to update Text5 based on Dropdown3 selection
function updateText5 () {
const dropdown3Value = this.getField('Dropdown3').value
const text5Field = this.getField('Text5')
if (dropdown3Value === 'Consolidate Debt Service Coverage Ratio C&I, CRE, AgCash, Non-Profit') {
text5Field.value = 'This is test paragraph 1 ' + target + and ' + frequency + ' and ' + calcmonths + ' and ' + date + " and " + calcmonths + ' end paragraph.'
} else if (dropdown3Value === 'Consolidate Debt Service Coverage Ratio, Less Distributions C&I, CRE, AgCash') {
text5Field.value = 'This is a test of paragraph 2 ' + frequency + ' and ' + date + ' and ' + target + '.'
} else if (dropdown3Value === 'Consolidate Minimum Current Ratio C&I, CRE') {
text5Field.value = 'This a test paragrapgh 3 ' + target + ' and ' + periodend + ' and ' + date + '.'
} else if (dropdown3Value === 'Consolidate Maximum Debt/TNW C&I, CRE') {
text5Field.value = 'This is a test paragraph 4' + target + 'and ' + periodend + ' and ' + calcmonths + " end."
}
}
// Set the custom calculation script for Dropdown3 to update Text5
this.getField("Dropdown3").setAction("Validate", "updateText5();");
// Initial call to set the value of Text5 based on the current selection of Dropdown3
updateText5();
Thank you!
