Hi Patrick!
Thanks for the follow up. :)
If you look at the ToInt function expression help inside of the Architect UI, there is an implementation that accepts a string parameter and if the submitted String value is a NOT_SET String, the ToInt function call will return a NOT_SET Integer. Therefore, the expression you have above will continue to be valid.
With regards to the dialing codes themselves, as you can see the dialingCode property on the phone number data type is a String. Similarly, there is read only System.Regions built-in variable available in call flows as well and if you were to use the following reference in an expression:
System.Regions.US.dialingCode
That will resolve to the String value "1" at runtime and not the Integer value 1. Currently with the workaround I originally posed, you could see if the dialing code for a phone number value is for the United States like this:
System.Regions.US.dialingCode == ToString(ToInt(ToPhoneNumber(Task.CallANI).dialingCode))
and eventually once the dialingCode fix is in place switch that to this:
System.Regions.US.dialingCode == ToPhoneNumber(Task.CallANI).dialingCode
If you want to cast the dialing code to an Integer, you can but if you also want to use the built in System.Regions variable like I showed above then you'd also need to perform a ToInt call:
ToInt(System.Regions.US.dialingCode) == ToInt(ToPhoneNumber(Task.CallANI).dialingCode)
And sure, if you want to use a hard coded value of 1 for the dialing code as an Integer this would work:
1 == ToInt(ToPhoneNumber(Task.CallANI).dialingCode)
I wanted to make sure I pointed out that natively Architect is dealing with dialing codes as String values and the System.Regions variable can improve expression readability. Internally the Architect parser resolves System.Regions.US.dialing to "1" at design time so there's no runtime penalty to use it over hard coding a String or Integer literal value for the dialing code.
One final note: Once we get the fix in place so that the dialingCode set on the returned phone number value from the ToPhoneNumber function call is a String, it will require that you republish the call flow to pick up that fix.
Thanks!
Jim