cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How to copy a Managed Metadata value to a single line text field?

Using on-prem SP & Nintex 2016.

I need to copy the value in a managed, metadata field called Route.  The javascript client ID is vRouteMMD.  The target field is called RouteCopy with a javascript client ID of vRouteCopy.  RouteCopy is not connected to any column.  I have used the follow javascript (note the "alert" returned 'undefined' when un-commented).  RouteCopy does not get populated.  I have tried numerous variations on this code, but no joy.    Its seems so simple . . .

NWF$(document).ready(function(){
var varRouteMMD = NWF$('#' + vRouteMMD).val();
//alert(varRouteMMD);
NWF$('#' + vRouteCopy).val(varRouteMMD);
});

Any suggestions would be greatly appreciated!

-Ken

0 Kudos
Reply
3 Replies
Workflow Hero

Re: How to copy a Managed Metadata value to a single line text field?

Hi Ken,

Can you try the following code?

NWF$(document).ready(function(){ NWF.FormFiller.Events.RegisterAfterReady(function() {
var mm = NWF$("#" + vRouteMMD);
var mm2 = NWF$("#" + vRouteCopy);
mm2.find("input[type='hidden']").val(mm.find("input[type='hidden']").val());
mm2.find(".ms-inputBox").append(mm.find(".ms-inputBox")[0].innerHTML);
}); });

Hope this works

Accept as Solution Reply
Workflow Hero

Re: How to copy a Managed Metadata value to a single line text field?

Caroline,

Thanks for the insight into getting the value from a Managed Metadata form control!

I have tried using this to put the MM form control value into a calculated field control.

However, the calculated field control does not get updated when the MM form control value changes (the MM form control does not seem to trigger the recalculation of CV fields).....

Am I missing something on getting a second form control field to automatically update when the MM form control value changes?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to copy a Managed Metadata value to a single line text field?

Sorry for the late reply.

If you'd like the calculated value to be updated when the MM form control value changes, you need to add the reference to the MM named control into the calculated value.

Hope this helps

0 Kudos
Accept as Solution Reply