Why Trim Transform not working for dynamic input

Hi Folks,

We need to handle trailing spaces at the beginning and end of a string. I am currently using a trim operation transform, but it only works when a static input is provided. When I pass an identity or account attribute, the spaces are not removed. Can you help me understand why this issue occurs and how to resolve it?

Thanks,
Siva.K

1 Like

Hi Siva,

Can you share your transform logic here

Thanks,
Shailee

Hi Mehta,

No custom logic. Direct transform only, I am using for fn and ln.

{
    "id": "",
    "name": "Trimtest",
    "type": "trim",
    "attributes": {
        "input": {
            "attributes": {
                "name": "firstname"
            },
            "type": "identityAttribute"
        }
    },
    "internal": false
}

Thanks,
Siva.K

1 Like

Not sure why it doesn’t work on dynamic inputs, but you can just map this transform in the firstname identity attribute.

{
  "type": "trim",
  "name": "Trim Transform"
}

Hi @Sivakrishna1993,

You may try below transform:

{
  "attributes": {
    "input": {
      "attributes": {
        "name": "firstname"
      },
      "type": "identityAttribute"
    }
  },
  "type": "trim",
  "name": "Trim Transform"
}

or use below for direct trim of firstname value:
{
  "type": "trim",
  "name": "Trim Transform"
}

Have you tried using the account attribute? In most cases, avoid using identity attributes, as the identity attribute calculation jobs will run in parallel.

Try using the template given below:
Check the attribute name and source name is correct and also should have some values. Also, make sure that, those values are populated correctly.

{
    "id": "",
    "name": "Trimtest",
    "type": "trim",
    "attributes": {
        "input": {
            "type": "accountAttribute",
            "attributes": {
                 "sourceName": "Name",
                 "attributeName": "FirstName"
            }
        }
    },
    "internal": false
}

But the original structure of the transform is,

{
  "type": "trim",
  "name": "Trim Transform"
}

Hi @GOKUL_ANANTH_M,

I cannot take it from source because data is not good. I am removing unwanted strings with replace transform and tag it to firstname attribute. So we need to read from identity Attribute only.
For testing purpose i have tested it with source attribute but not working.

Thanks you.
Siva.K

1 Like

Correct me If I am not right.

You are using the replace transform for firstName correct. If this is the case, then by referencing that particular transform (firstname transform), you can achieve this.

I am referring, something like below:

Hi

I try to use source attribute for trim function but still getting space.

{
    "name": "FirstNameReplaceChar",
    "type": "replaceAll",
    "attributes": {
        "input": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "input": {
                                "attributes": {
                                    "attributeName": "firstName",
                                    "sourceName": "SuccessFactor_EC_TC"
                                },
                                "type": "accountAttribute"
                            }
                        },
                        "type": "trim"
                    },
                    {
                        "attributes": {
                            "value": "-"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "table": {
            "A/P": "",
            "A/L": "",
            "D/O": "",
            "S/O": "",
            "Binte": "",
            "Binti": "",
            "Bin": "",
            "Bte": "",
            "Bt": ""
        }
    },
    "internal": false
}

Output:
First Name : " August"

1 Like

The transform you gave is fine, I couldn’t find any flaws over here.

If you are observing different behavior or outputs, it could be due to a few reasons:

  1. The firstName attribute value retrieved from the “SuccessFactor_EC_TC” source might be different from what you expect.
  2. There might be additional whitespace characters or invisible characters in the firstName value that are not being trimmed correctly.
  3. There could be an issue with the transform execution or the way the output is being displayed or stored.

To troubleshoot the issue, I recommend the following:

  1. Double-check the actual value of the firstName attribute retrieved from the “SuccessFactor_EC_TC” source to ensure it matches your expectations.
  2. Verify that the trim transform is correctly removing any leading or trailing whitespace characters.
  3. Check if there are any additional invisible characters or encoding issues in the firstName value that might affect the transform behavior.
  4. Examine how the transform output is being stored, displayed, or used in subsequent steps to ensure there are no unintended modifications.
1 Like

Test the below transform finally,

{
    "name": "FirstNameReplaceChar",
    "type": "replaceAll",
    "attributes": {
        "input": {
            "attributes": {
                "input": {
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "attributeName": "firstName",
                                    "sourceName": "SuccessFactor_EC_TC"
                                },
                                "type": "accountAttribute"
                            },
                            {
                                "attributes": {
                                    "value": "-"
                                },
                                "type": "static"
                            }
                        ]
                    },
                    "type": "firstValid"
                }
            },
            "type": "trim"
        },
        "table": {
            "A/P": "",
            "A/L": "",
            "D/O": "",
            "S/O": "",
            "Binte": "",
            "Binti": "",
            "Bin": "",
            "Bte": "",
            "Bt": ""
        }
    },
    "internal": false
}
1 Like

Hi Gokul,

Thank you for your efforts.

I have tried in different ways but no luck. Actual values are as expected. In transform no issue but not getting why trim not working for dynamic input. I have open a ticket with SailPoint.

Actual value direct from postman output : "firstName": " August",

Best Regards,
Siva.K

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.