# Workflows Define Variable

**URL:** <https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [July 7, 2023, 6:15pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019 "2023-07-07T18:15:02Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharvari](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sharvari](https://developer.sailpoint.com/discuss/u/sharvari)\
**Post date:** [July 7, 2023, 6:15pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/1 "2023-07-07T18:15:02Z")

</div>

We are trying to use two operators in Define Variable operator. The documentation suggests we can apply multiple (up to 50) but when testing the second operator doesn’t work and gives error, so we are able to apply only one operator per variable.

> **[Define Variable Operator - SailPoint Identity Services](https://documentation.sailpoint.com/saas/help/workflows/define-variable.html)**
>
> SailPoint Identity Services Documentation

We are trying to add 7 days to today ($.now()) and then use substring to extract the date part (MM-dd-yyyy).

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/d/d8fdd0a6bdc3ca3965556a6a39eb064b4d929461.png)

Has anyone tried using multiple operators within a single Define Variable Operator in Workflows?

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [July 7, 2023, 6:23pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/2 "2023-07-07T18:23:33Z")

</div>

Another thing to notice is only second operator is running. It is not taking the value from first operator

For example,

1. If second operator is “Trim” → Output: `""`
2. If second operator is “Concat” and variable B is “test” → Output: `"test"`

Essentially, the second operator is not able to do operations on first variable, i.e, Variable A .

---

<div class="post-metadata">

**Author:** ![sharvari](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sharvari](https://developer.sailpoint.com/discuss/u/sharvari)\
**Post date:** [July 12, 2023, 6:11am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/3 "2023-07-12T06:11:12Z")

</div>

Another issue with this step, when you click on Add operator button, it adds additional text boxes for the previous operator.

I clicked on Add operator button to add Operator 3 but it added additional fields for Operator 2 as well.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/9/98851a8115663b875d1745ff27fdbdcd17903d67.png)

I had to save workflow and step out of this action and comeback to it later and then the text boxes were gone but it was pretty confusing when trying to configure it.

One last thing, there is no option to delete an Operator if i don’t want to use it anymore. I had to delete the entire action and re-create it with just one operator to test my workflow.

@colin_mckibben @colin_mckibben Can we please provide these three issues as feedback to Workflow team.

---

<div class="post-metadata">

**Author:** ![amajumdar1](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@amajumdar1](https://developer.sailpoint.com/discuss/u/amajumdar1)\
**Post date:** [July 12, 2023, 7:56am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/4 "2023-07-12T07:56:03Z")

</div>

Hi @sharvari ,

How are you getting ($.now()) variable? When we try to put this is in define variable value we are getting error.Could you please help what we are missing here? We need to add certain days to current date.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/c/cb9a47385327706f4b6aafbf451a2e399d897702.png)

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [July 12, 2023, 8:34am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/5 "2023-07-12T08:34:54Z")

</div>

Hi Aditi,

To get $.now(), you need to make Variable A as Enter Variable and remove the paranthesis.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/f/f50f539dcbb3252e34538ec625656eff1b266191.png)

---

<div class="post-metadata">

**Author:** ![sharvari](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sharvari](https://developer.sailpoint.com/discuss/u/sharvari)\
**Post date:** [July 12, 2023, 8:35am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/6 "2023-07-12T08:35:00Z")

</div>

Just change the Enter value dropdown to Choose Variable and then provide $.now()

![image](https://global.discourse-cdn.com/sailpoint/original/2X/f/fa48de03549effbc1c5744b6483fb87f8cf41dcb.png)

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [July 12, 2023, 8:40am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/7 "2023-07-12T08:40:53Z")

</div>

Hi,

Another way to get rid of those text boxes is just to set the dropdown of (Choose Variable/Value) to the one which actually has your value.

For example, if you are setting value in “Enter Value” field and extra textbox appeared just set it to “Enter Value” (Extra one will disappear). This way you don’t have to reload the page.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [July 12, 2023, 1:05pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/8 "2023-07-12T13:05:00Z")

</div>

> [@sharvari](#):
>
> @colin_mckibben @jordan\_violet Can we please provide these three issues as feedback to Workflow team.

I have notified the workflow PM about this. Thank you for bringing it to our attention.

---

<div class="post-metadata">

**Author:** ![tburt](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tburt/32/8984_2.png) [@tburt](https://developer.sailpoint.com/discuss/u/tburt)\
**Post date:** [July 12, 2023, 5:02pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/9 "2023-07-12T17:02:39Z")

</div>

All,

Looking into the issues. The first one will require two Operators for now. This is still beta so we plan to support these in a single operator in the future but for now you will need to use two operators for this type of operation:

Define Variable: Attribute - $.now() - Operator 1: Add Time - 7 days  
Define Variable1: Attribute - $defineVariable.testDevCmDateIssue - Operator 1: Substring 0,10

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/f/fa53ddf012221ac455b211ea34856fa5e37aa64c.png)

---

<div class="post-metadata">

**Author:** ![tburt](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tburt/32/8984_2.png) [@tburt](https://developer.sailpoint.com/discuss/u/tburt)\
**Post date:** [July 12, 2023, 5:03pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/10 "2023-07-12T17:03:18Z")

</div>

We are looking into the odd UI behavior where the additional operators are shown as well.

---

<div class="post-metadata">

**Author:** ![tburt](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tburt/32/8984_2.png) [@tburt](https://developer.sailpoint.com/discuss/u/tburt)\
**Post date:** [July 12, 2023, 7:59pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/11 "2023-07-12T19:59:11Z")

</div>

Follow up: The team had already identified the UI anomaly and is pushing out a fix in the next week.

---

<div class="post-metadata">

**Author:** ![sharvari](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sharvari](https://developer.sailpoint.com/discuss/u/sharvari)\
**Post date:** [July 13, 2023, 3:04am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/12 "2023-07-13T03:04:49Z")

</div>

Thank you so much for the prompt action and responses.

Kindly let us know when multiple operator support is deployed for Define Variable.

---

<div class="post-metadata">

**Author:** ![tburt](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tburt/32/8984_2.png) [@tburt](https://developer.sailpoint.com/discuss/u/tburt)\
**Post date:** [July 13, 2023, 3:29pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/13 "2023-07-13T15:29:19Z")

</div>

Sharvari,

We are planning our goal UX experience for this quarter so ideally it should be delivered by end of September. The problem is not necessarily chaining operators but going from a date formatted value ISO8601 to a string. We will support this as part of the goal experience but not in the initial operator.

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [July 13, 2023, 6:18pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/14 "2023-07-13T18:18:23Z")

</div>

Hi Thomas,

We have observed the same behavior with string to string.

> [@atarodia](#):
>
> Another thing to notice is only second operator is running. It is not taking the value from first operator
> 
> For example,
> 
> 1. If second operator is “Trim” → Output: `""`
> 2. If second operator is “Concat” and variable B is “test” → Output: `"test"`
> 
> Essentially, the second operator is not able to do operations on first variable, i.e, Variable A .

---

<div class="post-metadata">

**Author:** ![tburt](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tburt/32/8984_2.png) [@tburt](https://developer.sailpoint.com/discuss/u/tburt)\
**Post date:** [July 13, 2023, 10:57pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/15 "2023-07-13T22:57:55Z")

</div>

Animesh,

Thank you. So in this case you have a string value that you are transforming in the 1st operator and in the second when you try to trim that string value the output is still empty “”?

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [July 14, 2023, 8:02am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/16 "2023-07-14T08:02:31Z")

</div>

Yes, that’s correct and when doing concat, only Variable B comes as output.

---

<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:** [September 12, 2023, 8:02am UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/17 "2023-09-12T08:02:43Z")

</div>

Closed on September 12, 2023, 8:02am UTC

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

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [July 25, 2024, 3:53pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable/14019/18 "2024-07-25T15:53:17Z")

</div>

This has since been fixed, and should no longer be an issue.
