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