Skip to main content
Known Participant
October 24, 2023
Answered

How to incorporate content from one field into another

  • October 24, 2023
  • 1 reply
  • 782 views

I have fields called CustomerName, Sex (which is a dropdown with male and female as the options) and a text field.

Currently, if male is chosen from the dropdown, 'xxx gave HIS permission for me to collect data.....', appears n the text field. If female is chosen, it says 'xxx gave HER permission....'.

I would like the xxx to be the persons' name from the CustomerName field, but I can't work out how to incorporate it. Can anyone help please?

This is what I'm currently using:

var Sex = this.getField("Dropdown7").value;
if (Sex=="male")event.value="xxx gave his verbal consent for me to collect personal data";
else if (Sex=="female")event.value="xxx gave her verbal consent for me to collect personal data";
else event.value = "";

 

This topic has been closed for replies.
Correct answer try67

var Name = this.getField("CustomerName").value;

var Sex = this.getField("Dropdown7").value;
if (Sex=="male")event.value=Name+" gave his verbal consent for me to collect personal data";
else if (Sex=="female")event.value=Name+" gave her verbal consent for me to collect personal data";
else event.value = "";

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 24, 2023

var Name = this.getField("CustomerName").value;

var Sex = this.getField("Dropdown7").value;
if (Sex=="male")event.value=Name+" gave his verbal consent for me to collect personal data";
else if (Sex=="female")event.value=Name+" gave her verbal consent for me to collect personal data";
else event.value = "";

jlehaneAuthor
Known Participant
October 24, 2023

So simple when you know how! Thank you @try67