HOW TO: Parameterize Expression Transformation in Informatica Cloud (IICS) ?

Spread the love

1. Introduction

In our earlier articles we have discussed how the source and target transformations can be parameterized in an Informatica Cloud mapping. By parameterizing the connection and object attributes of a source and target transformations, a complete parameterized mapping can be built. The parameterized mapping can then be used across multiple mapping tasks or in a dynamic mapping task.

The below image shows a mapping where source and target transformations are completely parameterized.

Parameterized Mapping
Parameterized Mapping
Parameters in Parameterized Mapping
Parameters in Parameterized Mapping

2. Expression Transformation in a Parameterized Mapping

When an expression transformation is added in a Parameterized Mapping as shown below, the fields and field expressions defined within the transformation will be applicable to all the tasks using this mapping, regardless of their source connections and objects.

Expression Transformation in Parameterized Mapping
Expression Transformation in Parameterized Mapping

In the example below, we have added a field called CREATE_TIMESTAMP. This addition will not affect its usage with multiple sources across different tasks. If there is a relevant field in the target where this field can be utilized, you can map it accordingly. Otherwise, it will remain unmapped.

Creating Fields in Expression Transformation
Creating Fields in Expression Transformation

However, consider a scenario where you need to transform data based on input fields. In such cases, the mapping cannot be entirely parameterized because the fields present in one source may not exist in another source.

For example, in the following scenario, we are adding a new field named FULL_NAME by concatenating the FIRST_NAME and LAST_NAME fields in the field expression. However, if you use a different source where the FIRST_NAME and LAST_NAME fields are absent, the mapping task will fail during job execution.

Adding Field Expression using Source Fields in Expression Transformation
Adding Field Expression using Source Fields in Expression Transformation

In such cases, to avoid building multiple mappings to handle the transformations in expression transformations, Informatica supports parameterizing the entire expression transformation within a mapping. This allows different fields to be created for various sources at the mapping task level.

3. Steps to Parameterize Expression Transformation

Follow the below steps to completely parameterize an Expression Transformation in Informatica Cloud Mapping.

1. In the Expression Transformation, go to Expression tab and select Allow additional fields and expressions during task creation option.

2. A new Parameter section is enabled. Click on New Parameter and create a parameter for expression transformation.

Parameterizing Expression Transformation
Parameterizing Expression Transformation

3. Click Save to save the changes in the mapping.

4. Create a Mapping Task using the mapping. Configure Source and Target sections of the task.

5. In the Input Parameters section of the mapping task, you will find the option to add additional fields under the parameter created for expression.

Input Parameters section in Mapping Task
Input Parameters section in Mapping Task

6. Click on + icon to create additional fields that are applicable to the current mapping task only.

Adding fields in Expression Transformation from Mapping task
Adding fields in Expression Transformation from Mapping task

7. Click Save to save the changes in Mapping Task.

4. Conclusion

Note that while parameterizing the expression transformation, we can simultaneously create fields within the expression transformation itself. These fields will apply to all mapping tasks that utilize the mapping. Additionally, we have the flexibility to create additional fields at the mapping task level wherever necessary.

In the example discussed above, the field CREATE_TIMESTAMP is created within the expression transformation of the mapping. Therefore, by default, this field is included in all mapping tasks that are based on this mapping.

The image below indicates that No Actions Available for the field CREATE_TIMESTAMP because it was created at the mapping level.

Default expression fields in Mapping task created in Mapping
Default expression fields in Mapping task created in Mapping

Parameterizing expression transformations is a great feature which reduces the need to create multiple components when building generic mappings for Informatica Cloud pipelines.

Subscribe to our Newsletter !!

Related Articles:

  • HOW TO: Resolve Decimal Precision Loss in Informatica Cloud (IICS)?

    When Enable High Precision property should be enabled and how it resolves the decimal precision loss or rounding issue in Informatica Cloud

    READ MORE

  • HOW TO: Read JSON files from AWS S3 in Informatica Cloud (IICS)?

    The process to read JSON files from AWS S3 using IICS is different reading from Secure agent machine. Learn how to read JSON files from AWS S3 using different methods.

    READ MORE

  • HOW TO: Use Informatica Cloud (IICS) Debugger

    Informatica Cloud Debugger helps you preview data to troubleshoot errors at any point in a mapping, even as you build it.

    READ MORE

Leave a Comment

Related Posts