10-22-2024 08:25 AM
I am working on a project that requires taking a "Customer Name" string and converting it to touch tone/decimal code so that we can transmit that name along with account number to our payment company via DTMF. (I know....welcome back to the '90s). The payment company's system needs a # before each decimal code and it only supports upper case.
If String customerName = "JIM JONES", the result needs to be String TTcustomerName = "#74#73#77#32#74#79#78#69#83"
This part is making my head hurt, so any good ideas are appreciated.
Solved! Go to Solution.
10-22-2024 10:03 AM
You can achieve this conversion by using Java code snippet applied in set variable node. On the screenshot is the result of active debug.
Link to the sample script: Link
Code in set variable node:
{
String tempCustomerName = "";
int i =0;
for(i = 0; i < customerName.length(); i++) {
tempCustomerName += "#" + (int)customerName.charAt(i);
}
return tempCustomerName;
}
Hope that helps you.
10-22-2024 10:03 AM
You can achieve this conversion by using Java code snippet applied in set variable node. On the screenshot is the result of active debug.
Link to the sample script: Link
Code in set variable node:
{
String tempCustomerName = "";
int i =0;
for(i = 0; i < customerName.length(); i++) {
tempCustomerName += "#" + (int)customerName.charAt(i);
}
return tempCustomerName;
}
Hope that helps you.
10-22-2024 10:38 AM
Thank you, Marek. That's exactly what I needed!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide