IF Statements in Expression - Mapping different data type fields

  • 132Views
  • Last Post 21 April 2022
  • Topic Is Solved
0
votes
Hari Vendra posted this 12 April 2022

Hi Team,

I hope you're doing good. 

I'm trying to build an If expression where we have two fields

  • Priority Rank - this field has multiple picklist values like A, B, C D, 3 - Cold, 2 - Warm, 1- Hot
  • Hit List - This is boolean (checkbox) true/false field

I would like to build an expression such that Priority Rank should be "1 - Hot" where Hit list = True

Could you help me with this, please?

Regards,

Hari Vendra 

Order By: Standard | Newest | Votes
0
votes
Olena Romanchuk posted this 14 April 2022

Hello Hari,    

Logically the 'If' expression is relevant for this case with the following syntax: condition1 ? result_if_true : result_if_false   However, the result_if_false is missing, you should specify the condition in case the result is false.


We assume the multi-picklist field has the array format.
thus the expression may look like this
Hit List == 'true' ? ["1 - Hot"] : NULL

Or, if you need all the other options to be selected in case Hit List = false, then the expression may look like this
Hit List == 'true' ? ["1 - Hot"] : ["A", "B", "C", "D", "3 - Cold", "2 - Warm"]  

Please note that the mentioned expressions are examples and the values may have another format You can select the multi-picklist values in Skyvia Query to check the specific format they are stored in.

Best regards,

Olena

Technical Support Engineer

0
votes
Hari Vendra posted this 18 April 2022

Hi Olena,

Thank you, I've tried the same and still getting some errors - Please see the below snip and advise, please?

0
votes
Olena Romanchuk posted this 18 April 2022

Hello Hari, 

Could you please share the package Id or link and name of the Target multi-picklist field with us? 
We look forward to your reply. 

Best regards,

Olena

Technical Support Engineer




0
votes
Hari Vendra posted this 19 April 2022

Hi Olena,

 

Thank you so much for your help. Here's the package link: https://app.skyvia.com/#/104956/packages/161073

 

Snip for If "expression" on opportunity task

 Below are the fields available

  • Priority Rank - this field has multiple picklist values like A, B, C D, 3 - Cold, 2 - Warm, 1- Hot
  • Hit List - This is boolean (checkbox) true/false field

Let me know if you need any further info from my end.

Regards,

Hari Vendra

1
votes
Olena Romanchuk posted this 19 April 2022

Hello Hari, 

Please try the following variant and inform us about the result:
Hit_List__c == true ? '1 - Hot' : null()

 

Best regards,

Olena

 

Technical Support Engineer

  • Supported by
  • Hari Vendra
0
votes
Hari Vendra posted this 20 April 2022

Hi Olena,

This works like a charm.

Thank you so much for your help on this - is there any documentation to better understand the if expressions, please?

Have a great day.

Thank you,

Hari Vendra

0
votes
Olena Romanchuk posted this 21 April 2022

Hello Hari, 

The available documentation is mostly related to syntax, but you can find the example of using conditional operators.
You can look at the following articles:
https://docs.skyvia.com/expression-syntax/
https://docs.skyvia.com/expression-syntax/operators.html
https://docs.skyvia.com/expression-syntax/examples.html


Best regards,

Olena

Technical Support Engineer

 




Close