I conducted a test where I copied a tab character from Notepad and pasted it into an Appian text field. Appian recognizes the tab character as a special character rather than treating it as empty spaces.
How can I configure or validate this so that Appian treats tab characters as empty spaces? Any insight would be appreciated.
Discussion posts and replies are publicly visible
Can you somehow visualize this? Some Screenshots?
In the "Objet" field, I performed the test mentioned above using the tab key, and it did not validate as empty as expected.
Can you share the code of that validation?
Be aware that whether a TAB is considered empty or not, very much depends on the specific use case. So a general solution is not possible. But you can easily add your own save logic that removes any entered white space.
https://docs.appian.com/suite/help/24.4/fnc_evaluation_save.html
textField( value: trim(recordType!Test.field) )
This was the only validation I did, it works for spaces but it doesn't for tab character.
I didn't see any reference for empty spaces on the link you sent above
In your saveInto, you should be able to strip out tabs and probably replace them with spaces. trim() *might* do this but i'd have to check, but otherwise, you could always do it manually - the tab character is (iirc) char(12).
be aware that the validation does not evaluate the value displayed to the user, but the value stored in your variable or rule input. So you will have to use a!save() to modify the saved value. Use the stripwith() function to remove any characters you want.
trim() doesn't work when the character is a tab char(9)
saveInto: { a!save( local!requisicao['value'], substitute(trim(save!value), char(9), "") ) },
I think we got the answer here, thank you all.
However, it needs some adjustments when it's a styledTextEditorField
ah yes, char(9) was what i was thinking of above, sorry - yeah you will probably be good to go with substitute(save!value, char(9), " ") (since you said you wanted a blank space).
no problem. By the way, the styledTextEditorField component inserts an empty <p></p> and then it doesn't consider it as empty or null for validation porpoises, any insights on this?
saveInto: { a!save( local!requisicao['recordType!MyRecord.field, substitute( substitute(trim(save!value), char(9), ""), "<p></p>", "" ) ) },
To ignore any HTML formatting in validations, you can use the striphtml() function.
I guess it depends on your use case. I haven't experimented with it all that much yet but I haven't had the need to keep the input totally blank in spite of background HTML tags.
Silas. B. Ferreira said:IMHO too much unnecessary verbosity