Taxonomy Lookup Value

As shown in the illustration, I can set the correct value in the text field.

fd.spRendered(function() {
fd.field('team').$on('change', function(value) {
fd.field('team').value = value;
fd.field('title3').value = fd.field('team').value.LookupValue + ' - ' + 'Team Member';
});

});

fd.spRendered(function() {
fd.field('CNSRClass1').$on('change', function(value) {
fd.field('CNSRClass1').SP.Taxonomy.Term = value;
fd.field('title1').value = fd.field('CNSRClass1').value.LookupValue + ' - ' + 'sp.taxonomy.js';
});

});

In the "New" form, the text does not appear, but in the Edit form, you can see and undefined returned. I am able to get [object Object] returned, but I still trying to get the same string as is seen in the "New" form choice.

I am getting better at this, but still need your guidance - many thanks!

Hello @shedev,

Please provide more details about what you want to achieve.

What are the field types? Do you want to populate field values when the drop-down field is changed?

The field type is "Taxonomy" from a SharePoint "Managed Metadata" column. In this case, I have a script that shows/hides 5 "Managed Metadata" fields based on a lookup choice of another field. I can get the show/hide to work, and the Term/choice (c. Movement disorders) displays as desired, but I can't get the text value (c. Movement disorders) to duplicate into the "Selected Classification" text field:

In SP, the column settings looks like:

SP_ManDataCol

In Plumsail, the 5 "Managed Metadata" fields are arranged inside a wizard and several "Text" fields are under an Accordion that I show/hide based on current user:

I want the value of any chosen text to also appear (get set) in the text field. Once I get into the edit screen, the text fields are used a read only view for all users, while the actual "Managed Metadata" fields are shown only to admins.

I have a number of fields I can successfully duplicate a text value, but this column type requires a little more drilling I think.

Thank you!

@shedev,

Please try out the following code to populate text field with the name of the selected option in the Managed Metadata field. Please use the internal names of the fields.

fd.spRendered(function() {
    fd.field('CNSRClass1').$on('change', function(value) {
        fd.field('Title').value = value.name;
    });
});

You can find more information about how to work with Managed Metadata in the documentation here.

Perfect - this worked. Thank you!

1 Like