How to change string based on input string

Hi,

I need to change the value of a string based on the input string.

For example:

Input Value: Product, replace with ITEM_NAME when mapping to a variable
Input Value: Quantity, replace with NUMBER_OF_ITEMS when mapping to a variable

Could somebody please suggest how do I achieve this?

Hi, Nida.
You can simply use the replace all function for this in an expression object. Map your source fields to the expression and use the replace all function (for example, for product, you can write: replaceall( field name , ‘product’, ITEM_NAME). Same will happen for Quantity as well. Hope this answers your query

Hi Nida,

Another solution to this might be to use a ListLookup transformation. Using it, you can specify all the possible incoming values in the SourceValue column and the value to replace with, in the Destination column.

Following is the relevant documentation link to List Lookup that might help you:
https://docs.astera.com/projects/centerprise/en/8/transformations/list-lookup-transformation.html