hi folks,
Is there a way to check for integer values for each value in an array? The array can have text or integer values.
I have already tried using like() but its not accurate as the size of the digits change i.e, double digits or triple digit numbers. Checking with tointeger() also failed as it converted text values into integers and when passed to the group() function it gave me an incorrect result.
TIA!!
Discussion posts and replies are publicly visible
Hi - You can check the value type in Appian in following way-
typeof(123) /*returns 1, depicts the integer value*/typeof({123}) /*returns 101, depicts the array integer value*/typeof("test string") /*returns 3, depicts the string value*/typeof({"test string"}) /*returns 103, depicts the array string value*/
Run a loop on your array and check the returned value of typeof function for each iteration.
Hope this helps!
Hi Chitra Sharma
That's correct but typeof("123") will return 3 i.e., a string. typeof can't be used to find out if the input is a number or a string when enclosed in double quotes.
Thanks!!!
HI Hema,
First convert the string into Integer, if the result is not null then it mean the string has all the character alphabets.
ex
tointeger("ABX3D") return 3
tointeger("1223") return 1223
tointeger("ABC") return null
Thanks
Vinay