Wednesday
Hello everyone,
With Automation studio, I need to do a character comparaison in Formula Mode. My currency code in Epicor is CAN but I need to save CAD in currency code of HudSpot.
I need to do something like this:
CurrencyCodeField = "CAN"? "CAD" : "USD"
I tried this but it doesn't work.
Solved! Go to Solution.
Thursday - last edited Thursday
Hi @SylvainA ,
Here is solution:
I prefer to add one more condition to have optimize solution to avoid the wrong response
<Input> == "CAN" : "CAD" : <input> == "USD" ? "USD" : "Wrong Input"
Thanks and Regards,
Shivakumar K A
Thursday - last edited Thursday
Hi @SylvainA,
Did you try using "match?" formula.(MatchFunction )
datapill.match?(/CAN/)?"CAD":"USD"
I have created a variable and using match function, I am validating if the variable contains the CAN.
If true passes CAD and false passes USD.
Regards,
Prudvi
Thursday - last edited Thursday
Hi @Prudvi,
Your solution not works in most cases, Say if the word is prefixed or suffixed with "CAN," it still returns "CAD."
For exmmple:
- "DECCAN" matches and results in "CAD."
- "CANBERRY" also returns "CAD."
While I understand that we are aiming for accurate input matching, our solution should be more optimized to handle such cases effectively.
Thanks and Regards,
Shivakumar K A
Thursday - last edited Thursday
Hi @shivakumara,
Thanks for pointing out.
Regards,
Prudvi
Thursday - last edited Thursday
Hi @SylvainA ,
Here is solution:
I prefer to add one more condition to have optimize solution to avoid the wrong response
<Input> == "CAN" : "CAD" : <input> == "USD" ? "USD" : "Wrong Input"
Thanks and Regards,
Shivakumar K A