How do I...?

Scripting: How to use logger.info()

Can anyone tell me how this works in the table scripting? I wanted to verify the value of a calculation but I can't get it return a variable, just a static value. Returning a variable always gives me an error even if the variable successfully writes to a field.

0 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Nathan Waterman shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Alex commented  ·   ·  Flag as inappropriate

    Hi Nathan,

    You can use logger.info() in several ways to validate that the script is working as designed and control the errors in the error logs when something does not work.

    For example, if you want to validate that a certain field has a value, you can write the script like this before the if() statement: logger.info(currentValues['Field Name']). This is to check that that field has a value in the first place. If you have a multi-step script, you can put a logger.info in the middle to check if the script made it that far: logger.info('Step 3 Completed) which will show "Step 3 Completed" in the error logs.

    Hope this helps!

    Alex

Feedback and Knowledge Base