Workflows Define Variable

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.

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

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

1 Like

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 .

1 Like

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.

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 @derek_putnam Can we please provide these three issues as feedback to Workflow team.

1 Like

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.

1 Like

Hi Aditi,

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

3 Likes

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

image

3 Likes

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.

3 Likes

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

1 Like

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

1 Like

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

1 Like

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

2 Likes

Thank you so much for the prompt action and responses.

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

2 Likes

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.

1 Like

Hi Thomas,

We have observed the same behavior with string to string.

1 Like

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 “”?

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

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

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