# Lookup Transform - Default Value

**URL:** <https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375>\
**Category:** SHF Discussion and Questions\
**Tags:** transforms, identity-security-cloud\
**Created:** [October 29, 2024, 10:22pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375 "2024-10-29T22:22:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [October 29, 2024, 10:22pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/1 "2024-10-29T22:22:54Z")

</div>

Does anyone know if it’s possible and if so, how to let an identity profile value pass through as the default value in a Lookup Transform?

Use Case: We have multiple authoritative sources with a “Company” value and need a transform to “standardize” the various values into a shortened consistent value for use downstream in Azure for dynamic distribution list membership.

Example:

- XYZ Inc. =\> XYZ Inc (removing the “.”)
- ABC /dba Special Name =\> ABC (removing the “doing business as” portion)
- …
- Default =\> Value passed directly from Identity Profile (Yes - it’s likely possible to do a FirstValid here, but trying to avoid that)

But if the value isn’t in the lookup table (i.e. lookup is corrections only) then the value passed in should be the actual value (Example ABC Inc =\> ABC Inc)

---

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [October 30, 2024, 5:16am UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/2 "2024-10-30T05:16:13Z")

</div>

@edmarks Did you mean you need to pass the identity attribute as the default value? If yes you can pass it like this:

```auto
"default": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "department"
                  }
            }

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Abhishek\_1995](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Abhishek\_1995](https://developer.sailpoint.com/discuss/u/Abhishek_1995)\
**Post date:** [October 30, 2024, 7:06am UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/3 "2024-10-30T07:06:59Z")

</div>

Hi @edmarks,

Please try the below transform it may work for you.

{  
“name”: “Testing”,  
“type”: “lookup”,  
“attributes”: {  
“input”: {  
“type”: “identityAttribute”,  
“attributes”: {  
“name”: “Company”  
}  
},  
“table”: {  
“XYZ Inc.”: “XYZ Inc”,  
“ABC@12”: “ABC”,  
“default”: {  
“type”: “identityAttribute”,  
“attributes”: {  
“name”: “Company”  
}  
}  
}  
}  
}

Thank you!

---

<div class="post-metadata">

**Author:** ![pablonovoa](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pablonovoa/32/18573_2.png) [@pablonovoa](https://developer.sailpoint.com/discuss/u/pablonovoa)\
**Post date:** [October 30, 2024, 10:16am UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/4 "2024-10-30T10:16:21Z")

</div>

Hello,

Maybe it can be more practical if you try to use a replace all or trim. For example, if you want to rename ABD Inc. to ABD Inc, just do a replace inc. to inc. and, if you need wnat to delele all that comes after @ or /, do a split transform.

Maybe, if you give a little bit more information i can help you more with a transform example

Hope it helps,  
Pablo

---

<div class="post-metadata">

**Author:** ![sup3rmark](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sup3rmark/32/36229_2.png) [@sup3rmark](https://developer.sailpoint.com/discuss/u/sup3rmark)\
**Post date:** [October 30, 2024, 3:03pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/5 "2024-10-30T15:03:55Z")

</div>

you could set your default value in the `lookup` as something static (like `PASSTHROUGH`, for example), and then wrap the `lookup` transform in a `static` transform, and if the value returned by the lookup is `PASSTHROUGH` or whatever you set that to, return the Company value, otherwise return the lookup result.

---

<div class="post-metadata">

**Author:** ![sagar\_kamalakar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sagar_kamalakar/32/18893_2.png) [@sagar\_kamalakar](https://developer.sailpoint.com/discuss/u/sagar_kamalakar)\
**Post date:** [October 30, 2024, 11:03pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/6 "2024-10-30T23:03:27Z")

</div>

@edmarks try below hope this will help

```auto
{
    "name": "calc Company",
    "type": "static",
    "attributes": {
        "companyAttr": {
            "type": "identityAttribute",
            "attributes": {
                "name": "company"
            }
        },
        "cmplookup": {
            "type": "lookup",
            "attributes": {
                "input": {
                    "attributes": {
                        "name": "company"
                    },
                    "type": "identityAttribute"
                },
                "table": {
                    "“XYZ Inc.": " XYZ Inc",
                    "ABC@12": "ABC",
                    "default": "Test"
                }              
            }
        },
        "value": "#if($cmplookup == 'Test') $companyAttr #{else} $cmplookup #end"
    }
}

```

---

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [October 31, 2024, 2:17pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/7 "2024-10-31T14:17:25Z")

</div>

I appreciate the communities help with this, but wanted to clarify the specifics of what I’m hoping can be done. The screen shot below shows how one (of multiple) identity profile is configured. In the transform, I’d like to default value to reference the value passed in via the EM1-DelimitedFile.organization. YES - the above examples can do this via referencing the source system attribute directly, but this is precisely what I’m trying to avoid because with multiple authoritative sources this would require a nested FirstValid transform order to be in sync with the identity profile order to ensure things works as expected. An alternative would be to create a separate transform for each auth source, but this seems like overkill.

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/b/7/b71405c5597e047a472a26a4eeac462b7eaccc16.png)

---

<div class="post-metadata">

**Author:** ![sup3rmark](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sup3rmark/32/36229_2.png) [@sup3rmark](https://developer.sailpoint.com/discuss/u/sup3rmark)\
**Post date:** [November 1, 2024, 12:38am UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/8 "2024-11-01T00:38:36Z")

</div>

If I’m understanding the issue correctly, I believe the only way to achieve what you’re looking to do here would be to have two Identity Attributes. The first one, call it `companyRaw`, you map like in your screenshot with no transform. Then the second, call it `company`, would leverage the previously described transforms, and reference the `companyRaw` identity attribute that can be mapped per Identity Profile.

---

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [November 4, 2024, 2:49pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/9 "2024-11-04T14:49:27Z")

</div>

I ended up “solving” this by using a combination of ideas from those of you that contributed, but still wishing/hoping there was a way to just reference the passed in value.

```auto
{
    "name": "Identity-Department",
    "type": "lookup",
    "attributes": {
        "table": {
            "Value to Replace1": "ReplacementValue1",
            "Value to Replace2": "ReplacementValue2",
            "default": {
                "type": "firstValid",
                "attributes": {
                    "values": [
                        {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "Auth Source 3 (Identity Profile Priority 1)",
                                "attributeName": "Department"
                            }
                        },
                        {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "Auth Source 1 (Identity Profile Priority 2)",
                                "attributeName": "Department"
                            }
                        },
                        {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "Auth Source 2 (Identity Profile Priority 3)",
                                "attributeName": "Department"
                            }
                        },
                        {
                            "type": "static",
                            "attributes": {
                                "value": "Unknown"
                            }
                        }
                    ]
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![nsorlien](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nsorlien](https://developer.sailpoint.com/discuss/u/nsorlien)\
**Post date:** [November 4, 2024, 8:41pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/10 "2024-11-04T20:41:54Z")

</div>

I typically use the [substring](https://developer.sailpoint.com/docs/extensibility/transforms/operations/substring) transform with a `begin` value of 0 to access the implicit input from the identity profile mapping within a transform. For example:

```json
{
    "name": "Identity-Department",
    "type": "lookup",
    "attributes": {
        "table": {
            "Value to Replace1": "ReplacementValue1",
            "Value to Replace2": "ReplacementValue2",
            "default": {
                "type": "firstValid",
                "attributes": {
                    "values": [
                        {
                            "type": "substring",
                            "attributes": {
                                "begin": 0
                            }
                        },
                        {
                            "type": "static",
                            "attributes": {
                                "value": "Unknown"
                            }
                        }
                    ]
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [November 5, 2024, 12:54pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/11 "2024-11-05T12:54:20Z")

</div>

@nsorlien This is EXACTLY what I was trying to accomplish! THANK YOU!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [January 4, 2025, 12:54pm UTC](https://developer.sailpoint.com/discuss/t/lookup-transform-default-value/87375/12 "2025-01-04T12:54:33Z")

</div>

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