Delimited Buildmap rule for creating new field

Hi Team,

I have written following delimited buidlmap rule for populating new field but code is not resulting in creating new column. Could anyone help me in this like what are the steps to be followed in writing build map rule?

{
    "description": "A BuildMap rule is used to manipulate the raw input data (provided via the rows and columns in the file) and build a map out of the incoming data.",
    "type": "BuildMap",
    "signature": {
        "input": [
            {
                "name": "col",
                "description": "An ordered list of the column names from the file’s header record or specified Columns list.",
                "type": null
            },
            {
                "name": "record",
                "description": "An ordered list of the values for the current record (parsed based on the specified delimiter)",
                "type": null
            },
            {
                "name": "application",
                "description": "The source object sent to the connector from IdentityNow.",
                "type": null
            },
            {
                "name": "schema",
                "description": "A reference to the Schema object for the Delimited File source being read.",
                "type": null
            }
        ],
        "output": null
    },
    "sourceCode": {
        "version": "1.0",
        "script": "\n\n \n\n    import sailpoint.connector.DelimitedFileConnector;\n\n\timport java.util.Map;\n\n    Map map = DelimitedFileConnector.defaultBuildMap( cols, record );\n\n    String resourceName = (String) map.get( \"Resource Name\" );\n\n    String accountName = (String) map.get( \"Account Name\" );\n\n     String PasswdIntAccessType1 = (String) map.get( \"PasswdIntAccessType1\" );\n \n\n\tList ResourceAccountNameRule = new ArrayList();\n\n    if ( resourceName != null && accountName != null && PasswdIntAccessType1!= null) {\n\n         ResourceAccountNameRule.add(resourceName);\n   \n         ResourceAccountNameRule.add(\" - \");\n\n         ResourceAccountNameRule.add(accountName);\n\t\t \n\t\t ResourceAccountNameRule.add(\" - \");\n\t\t \n\t\t ResourceAccountNameRule.add(PasswdIntAccessType1);\n\n        map.put(\"ResourceAccountNameRule\", ResourceAccountNameRule);\n\n    }\n\n    return map;\n\n \n\n "
    },
    "attributes": {
        "sourceVersion": "1.0"
    },
    "id": "42d093f426874bceb",
    "name": "Rule - BuildMap - Sample",
    "created": "2023-05-09T06:09:16.123Z",
    "modified": "2023-05-09T06:11:00.160Z"
}

Thanks
Kalyan

Hi Kalyan,

Could you please let us know what is your requirement ? I am not sure if you can add column in Build Map but rather add value in the column.

Thanks
Rakesh Bhati

Hi Rakesh Bhati,

My requirement is to combine two column values from the data feed and populate the new column field with this comined field which can be marked as mutilvalued and marked as an entitlement.

I am planning to write delimited build map rule so reuesting how can I acheive this requirement?

Thanks
Kalyan

For IdentityIQ I would first add the new attribute to the schema. As the buildmap rule will not create a new attribute in the schema, but only fill the content of the attribute.

Next to this, why do you add " - " to the List ResourceAccountNameRule? This is not logical.

  • Remold
1 Like

Hi Remold,

I would like to concatnate three attributes to new schema attribute with special character “-” and populate it as an multi valued entitlement in IDN.

Thanks
Kalyan

The trick with IdentityNow and build map rules (on delimited text sources) is that you need to make sure that:

  1. The original attributes from the delimited text file are represented in the source schema
  2. The new attribute (which combines the values you want) is also represented in the source schema

Example:
You have attribute A and attribute B in your source file, and want to combine both into attribute AB. Your schema must have; attribute A, attribute B, attribute AB.

2 Likes

Hi Edwin Sauve,

Thank you for your reply and yes the attribute A and attribute B are present in the source file and schema have; attribute A, attribute B, attribute AB.

Coudl you please share JSON code for combining attribute A and attribute B and attribute C to derive new attribute ABC?

Thanks
Kalyan

Ok, it is even slightly different then what I wrote down. Essentially, you need to overwrite one of the existing attributes, as you can see in the code snippet below:

import sailpoint.connector.DelimitedFileConnector;
	
Map map = DelimitedFileConnector.defaultBuildMap(cols, record);	

String attrA = (String) map.get("attrA");
String attrB = (String) map.get("attrB");

String attrAB = null;

if ( attrA != null && attrB != null ) {
	attrAB = metamodel + " " + caption;

	map.remove("attrA");
	map.remove("attrB");

	// Due to the way IDN Delimated connector works buildmap cannot create virtual column
	// only way to overwrite existing column with the combined data
	map.put("attrB", attrAB);
}
return map;
1 Like

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