Hello, I did find the solution here : https://walkingthestack.com/2013/11/18/lookup/
It got me very close. I now have the data in a calculated field using the lookup function, but I want to be able to allow the user to edit the field if needed. It does not seem like the calculated field allows that. Is there a way to copy the data from my calculated field into my task list's comment field?
Thanks
Hello All,
I found someones javascript example online but it does not give details. Perhaps someone can shed some light on how I should configure this.
The field I wish to fill in on my form is called "Comment" (this is the task list comment field)
The calculated field Name that will have the data is called "ResponseText"
The calculated field formula is : lookup("ECC Letter", "ID", ResponseTitles, "Letter")
The new example calculated field looks like:
UpdateTextBox(<Existing formula>)
The example javascript from online looks like: (* what is inpval? *Is TextBox in the example my Comment field?)
function UpdateTextBox(inpval){
NWF$('#'+TextBox).val(inpval);
return inpval;
}
Therefore my new calculated field looks like:
UpdateComment(lookup("ECC Letter", "ID", ResponseTitles, "Letter"))
the javascript (this is where I am probably messing up) looks like:
function UpdateComment(ResponseText){
NWF$('#'+Comment).val(ResponseText);
return ResponseText;
}
* I just get errors when previewing...
Thanks for helping
I've updated my javascript to look like :
function UpdateComment(value){
var ResponseText;
NWF$('#'+ResponseText).val(value);
return value;
}
No errors, but nothing happens.
I've never done anything like his, but intermediate calculation value control doesn't seem to me to be necessary.
I would say something like this should do it directly.
NWF.FormFiller.Events.RegisterAfterReady(function () {
NWF$('#' + jsvarResponeTitles).change(function(evt){
NWF.RuntimeFunctions.SPLookup("ECC Letter", "ID",NWF.RuntimeFunctions.parseLookup(evt.target.value,false),'Letter').done(function(data){
NWF$('#' + jsvarComments).val(data);
NWF.FormFiller.Functions.ProcessOnChange(NWF$('#' + jsvarComments));
});
});
});
Did this solution work for the question? I have a very similar requirement being proposed to me and this could possibly be what I am looking for. I basically need a set of buttons on the form (dynamically displayed based on a previous field's selection) that when clicked would populate a guide template into a multiple lines of text field to help them fill in the appropriate information.
This solution looks like it would be about 75% of the way there if it works!