====== Automatically add key/value pairs ====== ===== Introduction ===== When transforming incoming or outgoing documents, we often need a so-called recoding or translation of proper or foreign keys. For this purpose, value tables and value providers are usually created. Normally a trader does this when receiving PRICATs((price and catalog information of a commodity.)). Here then e.g. the commodity groups, colors and sizes data of the Liefaranten on the own keys are translated. For this a value provider was created for each attribute which contains all known keys ideally with designation. In addition a value table was prepared, which is used depending upon requirement global or partner-specifically. All this is already explained in detail in the HowTo [[en:howtos:recoding#vorbereitung|]]. ===== Procedure ===== If you want to fill the value provider and value table automatically with content, the following preparations are necessary: - a suitable [[en:prozessdefinition:repositorien:entitaetstyp:anlegen|documenttype]] for the transfer of the key-value pairs - a [[en:transformation:werteprovider:anlegen|valueprovider]] - a [[transformation:lookuptables:start|]] - a suitable [[en:kommunikation:kanal:start#incoming_communication_channels|receiving_channel]] - a job A to open the receive channel and delegate to job B - a job B to analyze and select the document type - a mapping with the document type as source and target object((This is actually only needed to formally fulfill the completeness of a mapping)). In this mapping the function **[[en:transformation:mappings:funktionen:abfragefunktionen:lookup:addlookupkeyvalue|AddLookupKeyValue()]]** is used to create the value provider with the new key((The value which should be returned as a result of a LookUp function.)) and the value table with the values to be translated and their assignment to the return value from the value provider. - a [[en:prozessdefinition:automatisierungen:automatisierungen|]] to start the Job A