Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!
SOLVED

[422] Invalid Parameter despite filtering out bad character

Avatar

Level 2

I have a scenario that ends in a custom API to do a POST call.

 

It's throwing an occasional "[422] Invalid Parameter" error. Apparently, some users are pasting control characters (namely TAB) into task names and when fusion throws them into the JSON response it's failing.

 

I've tried using the ascii() function, which seems to strip the character out, but the error is still being thrown, which I don't understand at all.

 

Thoughts?

1 Accepted Solution

Avatar

Correct answer by
Level 6

Fair enough. 
2 options: 

  1. the replace() function if you know it's really a tab only
  2. use the regex module to remove any characters that are NOT allowed. 

 

[^a-zA-Z0-9\.\-\(\)\[\]\{\}'":;\/,\-_\+ ]​

 

  • Some characters have a back-slash because they have special meaning in RegExp.

SveniX_0-1729617137817.png

 

 

View solution in original post

4 Replies

Avatar

Level 6

Try Trim()?

 

That should take care of whitespace - not sure about other non-printing characters

Avatar

Level 2

Trim() only takes care of the beginning and end of the string, the ones I'm dealing with are in the middle.

Avatar

Correct answer by
Level 6

Fair enough. 
2 options: 

  1. the replace() function if you know it's really a tab only
  2. use the regex module to remove any characters that are NOT allowed. 

 

[^a-zA-Z0-9\.\-\(\)\[\]\{\}'":;\/,\-_\+ ]​

 

  • Some characters have a back-slash because they have special meaning in RegExp.

SveniX_0-1729617137817.png