Sitedetout - Tutoriels informatiques

Créer une OptionList dans UCM

Creating metadata value relationships

I was recently asked an question about an interesting use case. They wanted content to be submitted into UCM with a particular ID in a custom metadata field. But they wanted that ID to be translated during submission into an employee name in another metadata field upon submission.

My initial thought was that this could be done with a dependent choice list (DCL). One option list field driving the choices in another. But this didn’t work in this case for a couple of reasons. First, the number of IDs could potentially be very large. So making that into a drop-down list would not be practical. The preference would be for that field to simply be a text field to type in the ID. Secondly, data could be submitted through different methods other then the web-based check-in form. And without an interface to select the DCL choices, the system needed a way to determine and populate the name field.

So instead I went the approach of having the value of the ID field drive the value of the Name field using the derived field approach in my rule. In looking at it though, it was easy to simply copy the value of the ID field into the Name field…but to have it look up and translate the value proved to be the tricky part.

InfoCheckinLabels.png

So here is the approach I took…

    1. First I created my two metadata fields as standard text fields in the Configuration Manager applet.
      md_emp_name.png
      md_emp_id.png
    1. Next I create a table that stores the relationship between the IDs and Names.
      md_table.png
    2. I then create a View into that table and set the column to the EmployeeID.
      md_view.png
    1. I now create a new Application Field and set it as an option list using the View I created in the previous step.
      md_applicationfield_600.png

      The reason I create it as an Application field is because I don’t need to display the field or store a value in it. I simply need to make use of the option list in the next step…

    2. Finally, I create a Rule in which I select the Employee Name field and turn on the ‘Is derived field’ checkbox. I edit the derived value and add a new condition. Because the option list is a Application field and not an Information field, I can’t use the Compute button. Instead, I insert this line directly in the Value field:@getFieldViewValue(“EmployeeMapping”,#active.xEmployeeID, “EmployeeName”)The “EmployeeMapping” parameter designates that the value should be pulled from the EmployeeMapping Application field that I had created in the previous step. The #active.xEmployeeID field is the ID value that should be pulled from what the user entered. “EmployeeName” is the column name in the table which has the value which corresponds to the ID. The extracted name then becomes the value within our Employee Name field.
      md_rule_600.png

That’s it. You can then add additional Rules to make the Name field read-only/hidden on the check-in page and such.


Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.

Chargement...
Menu Title

Powered by themekiller.com