Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

Get the value of a node

Hello, I converted a json object into a wa custom object, I want to get the value of the node words and average, How to define variables? Thanks in advance!


    

{
    "log_id":  260427505794930020,
    "direction":  0,
    "num":  1,
    "result":  [
                         {
                             "words":  "Windows XP",
                             "probability":  "@{variance=0.002108; average=0.954701; min=0.838457}"
                         }
                ]
}

    


Best Answer

The custom object that I used was a bit different from your example.


In your particular example, you can extract the value of the "probability" attribute using the following:


%NewCustomObject.result[0].probability%


Note that you cannot access the "variance", "average" and "min" values independently and that's because the value of the "probability" attribute is not a custom object, as it was in my example, but it's text type. But you can further parse this text to retrieve those as well.


For the rest of the attributes, you can see the path that you need to provide by double clicking on the value field in the "Variables" pane within the Process Designer.






ADMIN

Hi Abbyy,


For example, lets say you have a custom object similar to the following:



and the results attribute has the following value witch is also a custom object:



and the probability attribute has the following value (also a custom object):




Then you can access the value of the "average" attribute using the following path:


%NewCustomObject.results.probability.average%


You can use the above approach in order to see the path to all the available attributes for a custom object. 

Hello, thank you for your reply, using the variable output above will prompt an error


image


waj
(84 KB)
ADMIN
Answer

The custom object that I used was a bit different from your example.


In your particular example, you can extract the value of the "probability" attribute using the following:


%NewCustomObject.result[0].probability%


Note that you cannot access the "variance", "average" and "min" values independently and that's because the value of the "probability" attribute is not a custom object, as it was in my example, but it's text type. But you can further parse this text to retrieve those as well.


For the rest of the attributes, you can see the path that you need to provide by double clicking on the value field in the "Variables" pane within the Process Designer.





Login or Signup to post a comment