How to read value of a windows control?



How do I read value of a windows control? I am working with Dynamics Navision software and want to read a sum value that is in the footer section of a window. I am able to identify the object selector but how do I read the value of the object and assign to a variable?

Thanks in advance.


Hi @peke_robot,

You can do it 2 ways:

1st (if the application allows to copy the value): double-click on the UI control, copy the value using Ctrl-c, save to a variable using Clipboard action

2nd - use a UI selector with getText method in a custom action

Here is the sample custom action, you need to insert the variable name and the selector.

    output = 'variable_name'

def customScript() {

    variable_name = RString.of($("object_selector").getText())


Can we get and set value through window control selector?

Perfect - just the thing I was looking for!



I am having trouble passing the object_selector as input variable for the custom script. What is the appropriate format for the input in the 2nd example above?

When the object selector is hard coded into the script this works out fine.



@peke_robot you need to use it the same way as in other recorder actions, with dollar sign and curly brackets.

    input =  ['selector'],
    output = 'text'

def customScript() {

    text = RString.of($("${selector}").getText())



Ah ok – naturally this way!! Thanks!!


Thanks these worked out nicely.

Is there any way to do the reverse ie. use putText(), similarly as with web elements?


There is, you can do it using method setText.
I actually just posted a sample script for that in another topic yesterday :slightly_smiling_face:


Perfect - as this enables much more robust implementations in comparison to keyboard text entry.