โ04-08-2024 06:14 AM
Hi,
I have 3 variables - Receiver, ISA07, ISA08
I will have to update ISA07 and ISA08 variables based on the value of Receiver.
if Receiver has value as 12+0975677. I need to validate whether receiver variable has "+" value. If so I will update ISA07=12 and ISA08=0975677. How to achieve it in formula mode.
Thanks
Solved! Go to Solution.
โ04-08-2024 07:33 PM
Try this:
For ISA07:
Receiver.include?("+") ? "12" : ISA07
For ISA08:
Receiver.include?("+") ? "0975677" : ISA08
If Receiver does not include "+" the variables will remain the same.
โ04-09-2024 03:31 AM
Hi @MurugarajSa ,
You can use below formulae for the match
ISA07:
Receiver.match?(/[\/+]/)? "12" : "ISA07"
ISA08:
Receiver.match?(/[\/+]/)? "0975677" : "ISA08"
โ04-09-2024 09:35 AM
Will the Receiver value ALWAYS be "12+0975677" ? Or can the "12" and the "0975677" change?
For example, if you received "99+7777777", you would expect ISA07 = "99" and ISA08 = "7777777" ?
If this is the case, then you need to do this a bit differently:
ISA07:
receiver.match?(/[\/+]/) ? receiver.split(/[\/+]/)[0] : isa07
ISA08:
receiver.match?(/[\/+]/) ? receiver.split(/[\/+]/)[1] : isa08
Credit to @shivakumara for the regex
โ04-09-2024 09:35 AM
Will the Receiver value ALWAYS be "12+0975677" ? Or can the "12" and the "0975677" change?
For example, if you received "99+7777777", you would expect ISA07 = "99" and ISA08 = "7777777" ?
If this is the case, then you need to do this a bit differently:
ISA07:
receiver.match?(/[\/+]/) ? receiver.split(/[\/+]/)[0] : isa07
ISA08:
receiver.match?(/[\/+]/) ? receiver.split(/[\/+]/)[1] : isa08
Credit to @shivakumara for the regex
โ04-09-2024 10:57 AM