コミュニティアチーブメントバーを展開する。

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

Checking if field data = numeric value (equivalent of ISNUMBER)?

Avatar

Level 3

We have an issue where some users accidentally enter a non-numeric value in a custom field. This has resulted in downstream issues with some of the python/API scripts that we run to load data into projects.

I'd like to create an exception report where I could check if the custom field has a non-numeric value and where the field is not blank. I reviewed the list of expressions available in WF and didn't see anything that would work.

Anyone have any creative suggestions? Thank you!

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

4 返信

Avatar

Community Advisor

Hi Hrug,

I often refer to this Calculated data expressions reference in such cases, and for your Is This Numeric challenge, can suggest a few options:

  • In your exception report, make a column to attempt to take the square root using SQRT: rows with non numeric entries (provided they are > 0) will return values, but otherwise, an error
  • Similarly, you could filter for rows where "My Field" is Not Equal to "NUMBER(My Field) + 0", since a number will be the same (5 = 5 + 0), but a string will not (apple <> apple + 0)
  • Best of all, though, if it's possible, would be to change that parameter to be a Number, rather than a Text, so you'll avoid the problem in the first place by having Workfront deny entry of anything BUT real numbers

Regards,

Doug

Avatar

Level 3

Thanks Doug. On the last suggestion, can you please elaborate? Do you mean format the custom form field as a Number? Anything else I can do to reject non-numeric input?

Avatar

Level 3

Think I got this figured out, but another way. I created another calc field that checks the LEN() of "My Field". If length of the data in "My Field" is <> 12, then it returns "Error". Now I can report on the "Error" field separately in a report.

Avatar

Community Advisor

Hi Hrug,

Glad you got something worked out. What I was referring to was the data type of the Custom Parameter: when you create it, you could choose "Number" instead of "Text" to ensure that only numbers are allowed to be entered.

Regards,

Doug