cancel
Showing results for 
Search instead for 
Did you mean: 

Workato Hacks: How to use dates in conditions

meghan-legaspi
Community Manager
Community Manager

Hey, Pros!

String-formula-1.jpeg

Conditions and unaccepted data types

When working with conditions in our recipe, we may need to work with different data types such as date, string, array, number, etc. However, depending on the condition that you have chosen, the accepted data type defers. This may pose a problem if the condition (e.g. contains, equals to, etc.) you need in your recipe does not accept your required data type.

Let’s say you only want to process events with a start date in the year 2022. This would mean:

  • Trigger data: Start Date
  • Condition: Contains
  • Value: 2022

Here’s the problem – the trigger data is a date data type while the chosen condition contains only accepts array and string data types. However, I still want to check the date as a condition before moving forward with this automation. How can I troubleshoot this issue then?

meghanlegaspi_0-1671548201276.png

Back to basics: what are conditions?

Conditions are additional rules that you may add to control the flow of your recipe. This allows you to create more precise automations based on your business needs.

Let’s say you want to create a recipe that automatically escalates high priority support cases to the engineering team by connecting Salesforce to Jira – in this case, you may add a condition that limits only case types of Priority = High to be processed in your recipe.

In your recipe, you may include conditions in both triggers – trigger conditions – as well as actions – conditional actions.

meghanlegaspi_1-1671548217347.png

Different conditions and their accepted data types

Below is a list of available conditions and the data types accepted.

  • contains – Array, String
  • starts with – String
  • ends with – String
  • doesn’t contain – Array, String
  • doesn’t start with – String
  • doesn’t end with – String
  • equals – Accepts all data type
  • does not equals – Accepts all data type
  • greater than – String, Date, Timestamp, Integer, Number, Boolean
  • less than – String, Date, Timestamp, Integer, Number, Boolean
  • is true – Boolean
  • is not true – Boolean
  • is present – Accepts all data type
  • is not present – Accepts all data type

Depending on the condition that you have chosen, the data type it supports defer. For example, the condition contains only accepts data types.

Using formula mode to convert your data type

Here’s how to troubleshoot the problem – use a formula to convert the current data type to your desired data type. Below, you’ll find a step-by-step tutorial on how to convert a date data type to a string data type.

In this example, we want to set up a trigger to filter for new or updated Salesforce cases that was last modified only in 2022. In summary:

  • Trigger data: Last Modified Date
  • Condition: contains
  • Value: 2022

⚙️ Get the step-by-step for this hack and more from Workato's Product Hub: https://www.workato.com/product-hub/date-conditions-unaccepted-data-type/?utm_source=WorkatoPros&utm...

Happy Automating!
Meghan

0 REPLIES 0