parseInt (@Unique ID)

Answered

Comments

1 comment

  • Stefan Ukena

    Hi Павел,

    your solution is correct from a JavaScript perspective, but Podio is being hard on you because it uses "test data" in the @Unique ID field that is not a number. (It usually uses "INV-123" for the unique id in this case and parseInd('INV-123') will result in NaN (ie. not a number)). But this work-around does the trick:

    var uid = parseInt(@Unique ID);
    isNaN(uid) ? 0 : uid +2
    

    This will return 0 if the unique id is really not a number (which shouldn't be the case after you save the app, and uid+2 otherwise. More importantly, this will let you save your calculation without Podio complaining. :)

    Best,
    Stefan

    dieKollaborateure.com - Podio Training+Consulting+Development English & Deutsch

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk