The only problem I’m running into is that it’s literally passing “#text18” for the field. I get it, the system is doing as it’s told. I just can’t figure out how to pass an actual piece of dynamic text to the dataset. What’s the formatting needed for that?
But they all just print normal text. I’m wondering if the formatting is wrong, but also if the Field Type needs to be changed. What would be best to receive this data?
For context, #text18 is coming from #dataset2 and the submit button is adding a new line to #dataset1 with additional user-supplied information. I’ve tried setting the Field Type for jobApplied to ‘Reference’ with the Referenced Collection’ set to #dataset2. It should just be a string of numbers by the time it is actually received by #dataset1.
To summarize:
Problem 1: How should I format the second argument within .setFieldValue to pass dynamic data?
Problem 2: How should I set the Field Type to receive this data?
Thanks for replying, Moshe. I’ve confirmed the FieldType is text, but I’m still not getting the values from the page into the dataset.
I changed one value slightly, so we can pass multiple FieldValues in one go:
As I said, if you look at t he API for setFieldValues you will see that the value needs to be the real string you want to apply and not an object id like you specified.
try using $w(’ #text18 ').text instead of plain “#text18”
returns nothing for the fields of jobApplied and jobTitle. Putting double quotes around “$w(#text18’).text” does pass text to those fields, but the text that’s within the quotes. I believe this is expected.
edit: The mistake was using a single quote, or apostrophe, within the parentheses. The below works perfectly: