IdentityNow Transforms - Lookup

IdentityNow Transforms - Lookup

Overview

A lookup transform takes in incoming string value and compares it to a list of key-value pairs to determine which output to return. If the incoming data matches a key, the corresponding value is returned. If no key is matched, the table's optional default value is returned.

Other Considerations

  • If the input does not match any key value within the table, and no default value is provided, the transform will return null.
  • SailPoint recommends keeping the table to be 100 entries or less. While there are technically no hard size constraints on the number of keys and values, the larger these objects are they more difficult to maintain and use, and larger tables can slow down transform fetching and calculation.

 

Transform Structure

The structure of a lookup transform involves a table entry of key-value pairs in addition to the standard type and name attributes that are required for all transforms:

Example

{
  "attributes": {
    "table": {
        "USA": "Americas",
        "FRA": "EMEA",
        "AUS": "APAC",
        "default": "Unknown Region"
    }
  },
  "type": "lookup",
  "name": "Test Lookup Transform"
}

Attributes

  • Required Attributes

    • type - This must always be set to lookup

    • name - This is a required attribute for all transforms, and represents the name of the transform as it will appear in the UI's dropdowns

    • table - This is a JSON object of key-value pairs. The key is the string that will attempt to be matched to the input, and the value is the output string that should be returned if the key is matched

      • Note the use of the optional default key value here; if none of the three countries in the above example match the input string, the transform will return "Unknown Region" for the attribute that is mapped to this transform.
  • Optional Attributes

    • requiresPeriodicRefresh - A true or false value that indicates whether the transform logic should be re-evaluated every evening as part of the identity refresh process.
    • input - This is an optional attribute that can explicitly define the input data which will be fed into the transform logic. If input is not provided, the transform will take its input from the source and attribute combination configured via the UI.

 

Examples

Example 1

{
  "attributes": {
    "table": {
        "512": "Austin",
        "281": "Houston",
        "214": "Dallas",
        "210": "San Antonio"
    }
  },
  "type": "lookup",
  "name": "Test Lookup Transform"
}

This transform attempts to map a telephone area code to a city in Texas. There is no default entry in the table map so the transform will return null if an area code that is not one of the provided four values is supplied.

Example 2

{
  "attributes": {
    "table": {
        "12450": "Product",
        "12451": "Engineering",
        "12452": "DevOps",
        "12500": "Marketing",
        "12510": "Sales and Revenue",
        "12520": "Professional Services",
        "12530": "Customer Success",
        "12540": "Support",
        "12600": "Human Resources",
        "12700": "Accounting",
        "12710": "Finance",
        "12720": "Finance",
        "12800": "Information Technology",
        "12810": "Help Desk",
        "12820": "Security",
        "default": "Unknown"
    }
  },
  "type": "lookup",
  "name": "Cost Center to Department"
}

The above transform takes a cost center value and translates this to a department name. This shows that multiple key values can be mapped to the same output values (see Finance). However, duplicate key values are not allowed and will throw an error. If a cost center is that isn’t in the list then “Unknown” is returned by virtue of the default keyword.

 

References

  • N/A
Comments

Hi @hari_patel 

Hope you're doing great.

We're planning to use this lookup transform, to format incoming data and pass it to downstream apps. Is there a limit on the size of the table we define in this transform (We may need to have 500-1000 rows in the table). Also, If there is a way of defining a table without size limit in IDN and having the transform do lookup from that table, I will follow that approach.

Thanks in advance.

@gadiparthiv I think we can.

In one of our use case we used around 2000+ rows.

-Abhinov

SailPoint recommends keeping the table to be 100 entries or less. While there are technically no hard size constraints on the number of keys and values, the larger these objects are they more difficult to maintain and use, and larger tables can slow down transform fetching and calculation. 

We have seen customers have a 1000 or more.  Its not ideal, but it will work... slower.

@neil_mcglennonDoes the lookup transform perform like a hash table or a switch statement? Also does it need to be loaded for each user or is it loaded one time then applied to all of the users?

Hi @neil_mcglennon ,

I need to use this transform and check if the value is empty, otherwise I use default. It seems not to be working. Do you have any idea about how to do it ?

Thanks.

Same here. I would also like to have empty-string "" or NULL or "empty_or_null" as an option. How do I do that? That doesn't seem like a far fetched feature.

Hi @Florian81 ,

I finally used the « Static » type transform with the « firstValid » option. Basically, you specify your source attribute and, if not set, you can define a static value, and compare on it on the « value » attribute.

Hi @khalilgahbiche 

Thank you for your insight. Seems like a feasible workaround. I would prefer though, if we had the option to do it "right" within the lookup-table.

my 2 cents

@Florian81 ,

If you're interested, here's what I did : 

{
	"name": "<name_here>",
	"type": "static",
	"attributes": {
		"<attribute_name_here>": {
			"attributes": {
				"values": [
					{
						"attributes": {
							"sourceName": "<source_name_here>",
							"attributeName": "<attribute_name_here>"
						},
						"type": "accountAttribute"
					},
					"0"
				]
			},
			"type": "firstValid"
		},
		"value": "#if($<attribute_name_here>==0)#Value1{else}Value2#end"
	}
}

Keep me posted if you find how to do it with Lookup transform  

Thanks.

Version history
Revision #:
4 of 4
Last update:
‎Mar 04, 2022 11:44 AM
Updated by: