Skip to main content

In a workflow, how do you access the "Object" built-in object's methods?

Comments

6 comments

  • Stefan Schweigert

    Hi there,

     

    When you use the '=' operator, this indicates that the value you are entering is an expression, which allows you to access object properties.

     

    As a basic example, you can use the Create Value with an input of ={"hi": 2} to create an object, then access that property value using =$value1.result.hi

     

    Thanks, Stefan

    0
  • Permanently deleted user

    Stefan,

     

    My issue is not the operator, which I am using. I should have been more descriptive in my OP, sorry. I am getting errors like " Object is undefined" or "Array is undefined" when I try to access those primitives in the sandbox.

     

    For example, I might try to run a Create Value activity with an expression parameter of "= Object.create({})" and end up with an exception from a TypeError: "[WF: expression evaluation error] The given expression could not be evaluated. \" Object.create({})\" Object is undefined"

     

    Is this unexpected behavior, or perhaps something related to the sandbox environment?

    0
  • Permanently deleted user

    The issue isn't just with primitives either, I see the same behavior when trying to create an empty extent "[WF: expression evaluation error] The given expression could not be evaluated. \" new esri.geometry.Extent()\" esri is undefined". I feel like I'm missing something simple here.

    0
  • Stefan Schweigert

    It is not possible to execute Javascript commands in this way within workflow; one reason being to allow support for both the 3.x and 4.x Esri JSAPI.

     

    In order to create an extent, you could use the Get Geometry Extent activity with an input geometry, instead of creating a blank extent then populating it.

    0
  • Permanently deleted user

    Aha, thank you! So there are no ways to access the esri functions and I get that...but is there any way to invoke the array.push() function in a workflow? Do I have any options to do something like that, or do I need to find another way to skin that sort of cat?

    0
  • Stefan Schweigert

    No problem. The Collection activities include the ability to add items to collections, which should fit your use case.

    0

Please sign in to leave a comment.