# MDM routine

Availability-note[Deprecated](https://help.talend.com/r/en-US/Cloud/labels-on-talend-help-center/availability-deprecated)

This content is deprecated.

Available in...

* Data Fabric
* MDM Platform
* Qlik Talend Cloud Enterprise Edition
* Qlik Talend Cloud Premium Edition

The table below lists some useful MDM routine functions including those for mangling foreign keys. In MDM, you usually need to mangle foreign keys to accommodate to compound keys.

Useful MDM routine functionsUseful MDMMDM routine functions

| Function | Description | Syntax |
| --- | --- | --- |
| getFK | Returns one of the foreign key components by position in a mangled foreign<br>key.<br><br>Note that the position is specified by an integer starting<br>from 0. | MDM.getFK<br><br>For example:<br><br><br>getFK("[fk1][fk2][fk3]",1),<br><br>which<br>will return the second foreign key component in the composite<br>foreign key. The output message will be "fk2". |
| getWSClientTimeout | Gets webservice client timeout information from jvm param<br>setting. | MDM.getWSClientTimeout(String property) |
| createFK | Returns the foreign key string by a single key (String singleKey). | MDM.createFK<br><br>For example:<br><br><br>createFK("0"),<br><br>which will return a<br>foreign key created with the id provided. The output message will be<br>"[0]". |
| createFK | Returns the foreign key string by a key list (String[] keys). | MDM.createFK<br><br>For example:<br><br><br>createFK({"0","1"}),<br><br>which will return a foreign key with the ids provided. The<br>output message will be "[0][1]". |
| createReturnMessage | Generates an error message with the content of msg<br>and error code of code. | MDM.createReturnMessage(String msg, int<br>code) |
| createReturnMessage | Generates a report message with the content of msg<br>and type of type. | MDM.createReturnMessage(String msg, String<br>type) |
| getRepeatingElement | Gets repeating element in an XML string according to the xpath and<br>position.<br><br>Note that the position is specified by an integer<br>starting from 0. | MDM.getRepeatingElement<br><br>For example:<br><br><br>getRepeatingElement("&lt;Product&gt;&lt;Features&gt;&lt;Feature&gt;color&lt;/Feature&gt;&lt;Feature&gt;size&lt;/Feature&gt;&lt;/Features&gt;&lt;/Product&gt;","/Product/Features/Feature",1),<br><br>which<br>will extract the second multi-occurrence element described by the<br>xpath node from the XML string provided. The output message will be<br>"size". |
| hasRepeatingElement | Checks repeating elements in an XML string according to the xpath and the<br>text. | MDM.hasRepeatingElement<br><br>For example:<br><br><br>hasRepeatingElement("&lt;Product&gt;&lt;Features&gt;&lt;Feature&gt;color&lt;/Feature&gt;&lt;Feature&gt;size&lt;/Feature&gt;&lt;/Features&gt;&lt;/Product&gt;","/Product/Features/Feature","size"),<br><br>which<br>will return the result about whether the specified multi-occurrence<br>element described by the xpath node and the text "size"<br>exist in the XML string provided. The output message will be<br>"true". |
| listRepeatingElement | Lists repeating elements in an XML string according to the xpath and the<br>delimiter.<br><br>Note that the delimiter is wrapped by single<br>quotes. | MDM.listRepeatingElement<br><br>For example:<br><br><br>listRepeatingElement("&lt;Product&gt;&lt;Features&gt;&lt;Feature&gt;color&lt;/Feature&gt;&lt;Feature&gt;size&lt;/Feature&gt;&lt;/Features&gt;&lt;/Product&gt;",<br>"/Product/Features/Feature",',')<br>,<br><br>which will list all the multi-occurrence elements<br>described by the xpath node from the XML string provided with the<br>specified delimiter. The output message will be "color,<br>size". |
| addRepeatingElement | Adds repeating elements in an XML string according to the xpath and the<br>text. | MDM.addRepeatingElement<br><br>For example:<br><br><br>addRepeatingElement("&lt;Product&gt;&lt;Features&gt;&lt;Feature&gt;color&lt;/Feature&gt;&lt;Feature&gt;size&lt;/Feature&gt;&lt;/Features&gt;&lt;/Product&gt;",<br>"/Product/Features/Feature","model"),<br><br>which<br>will add a new multi-occurence element described by the combination<br>of the xpath node and the text to the XML string provided. The<br>output message will<br>be<br><br>```<br><Product><br><Features><br><Feature>color</Feature><br><Feature>size</Feature><br><Feature>model</Feature><br></Features><br></Product><br>```<br><br>. |
| setLanguageVariant | Adds or updates an ISO variant to the multilingual text value. | MDM.setLanguageVariant<br><br>For example:<br><br><br>setLanguageVariant("EN","abc","[EN:ab][FR:ab\_fr]"),<br><br>which will update the EN variant to be "abc". The<br>output message will be [EN:abc][FR:ab\_fr]. |
| setLanguageVariant | Adds or updates an ISO variant to the multilingual text value with the<br>default ISO and the sort option for the output message.<br><br>If the sort<br>option is set to "true", the message will be output in<br>alphabetical order. | MDM.setLanguageVariant<br><br>For example:<br><br><br>setLanguageVariant("FR","ab\_fr","ab","EN",<br>true), which will add the FR variant "ab\_fr".<br>The output message will be [EN:ab][FR:ab\_fr]. |
| getLanguageVariant | Gets an ISO value from a multilingual text value with the default ISO<br>fallback.<br><br>If the ISO value requested is not found, the default ISO<br>value will be returned. | MDM.getLanguageVariant<br><br>For example:<br><br><br>getLanguageVariant("DE","EN","[EN:ab][FR:ab\_fr]"),<br>which will return the default EN value "ab" because the DE<br>value requested is not found. |
| getLanguageVariant | Gets an ISO value from a multilingual text value.<br><br>If the ISO value<br>requested is not found, the null value will be returned. | MDM.getLanguageVariant<br><br>For example:<br><br><br>getLanguageVariant("FR","[EN:ab][FR:ab\_fr]"),<br>which will return the requested FR value "ab\_fr". |

### In this section

* [Returning one component of a mangled foreign key](https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2025-01/returning-one-component-of-mangled-foreign-key)
* [Handling ISO variants or get an ISO value from a multilingual text](https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2025-01/handling-iso-variants-or-get-iso-value-from-multilingual-text)