How do I...?

Scripting: If currentValues[] is a Map, why does .values() give me an error?

If currentValues["Total"] is a Map of name/value pairs why does assigning it to m1 and then calling m1.values() not return the value?

e.g.
def m1 = currentValues["Testing"]
m1.values()

How else can I reference the value in currentValues["Testing'] ?

3 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 →

2 comments

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

    Witte,
    I don't have a specific thing that I am trying to attempt. Rather I am trying to get to grips with limitations of Groovy in the context of table scripts. Stuff I can get to work in Groovy console does not work when applied to TrackVia.

  • Witte commented  ·   ·  Flag as inappropriate

    Hello Nathan,

    It can be difficult to fully answer app script questions over Community Forum posts, as we need more information related to your specific use case to fully understand the circumstances surrounding your script. However, do keep in mind that currentValues[‘fieldOrRelationship’] only returns a map if the ‘ fieldOrRelationship’ is a relationship. Otherwise, it returns a type appropriate to the field type: Single Line -> String, Number -> Double, Checkbox -> List, etc.

    Depending on the type of fields you are attempting to reference, it is also worth noting that calculated fields cannot be referenced in app scripts.

    Please feel free to give our Support Team a call at 800-673-3302 at your convenience. If you can walk us through what you are attempting to accomplish we can probably provide more details on where you should go next.

    Regards,

    Witte

Feedback and Knowledge Base