December 3, 20178 yr I'm looking for a calculation to use as a flag for any letters/characters that aren't approved for use in a spefic field; the approved characters are: dMmy/.- ...and those characters can appear in any order and in any number...so that negates using PatternCount unless I make a multi-line case statement using PatternCount for each approved character, but that sounds klunky. I also tried using Filter as part of an equation but I couldn't get it to work. Your help would be appreciated. Thanks!
December 3, 20178 yr You can use filter, but you'll need to compare it to the original string to see if there's a difference. In the filter function, you specify all the characters you allow. You can compare the result of the filter function to see if any characters have been removed. like so: If( string = filter( string; "dMm/.-" ); "ok"; "not ok" )
December 3, 20178 yr Hi TeacherED, Try Substitute ( YourTextField ; ["d"; ""]; ["M"; ""]; ["m"; ""]; ["y"; ""]; ["/"; ""]; ["."; ""]; ["-"; ""] ) HTH Lee
December 3, 20178 yr TeacherEd, try Let( ~finder = Substitute ( YourTextField ; ["d"; "§"]; ["M"; "§"]; ["m"; "§"]; ["y"; "§"]; ["/"; "§"]; ["."; "§"]; ["-"; "§"] ); If(length(YourTextField) > PatternCount(~finder; "§"); "Error Message"; YourTextField) ) § is option-5 on a Mac; you can use any character you are certain will not appear in YourTextField. Edited December 3, 20178 yr by doughemi
Create an account or sign in to comment