Json object in TypeInto

How do we use a jsonobject in TypeInto activity without converting it into string as braces in the json is omitted
For example the jsonoject is as shown below :
“Name”: “fghijkl”
“Age” : “12”
“Location”: “vbnmzxc”
“Timezone”: “cst”}
After the type into activity
Name”: “fghijkl”
“Age” : “12”
“Location”: “vbnmzxc”
“Timezone”: “cst”}
The braces is omitted.
Any suggestions.

Square brackets are used to indicate special keys. You can escape them by putting double brackets, f.e. like this: yourString.Replace("[", “[[”) (there’s no need to escape the closing brackets)

I cannot change any content in the json object. I need to be able to write the json into the application…But the gets omitted.
Any suggestions

give a try on the simulateType flag of this activity.
please share some screenshots from the result after TypeInto from the field. We assume that it is related to a webpage, right?

The type into doesn’t accept the object unless we add .ToString to it. I tired simulate type but it didn’t make any change in the web.

This is how it looks.

yes and this also correct. You want enter the JSON string.
Give a try on escaping on the fly

if needed also append: .Replace("]","]]")

Yes I tried the replace [ with [[ but it doesn’t change.
Once the Object is converted to string it doesn’t show the anymore.

a quick check with following was working

not replacing [ with [[ was failling.

Please share with us screenshots of your type Into modeling. thanks

I just tried for a sample TypeInto .
Please see the pics below

It didn’t make the change

so we do see that it is working, we do have the [ ] in the box
Check the original JSON as well

For a complete json it’s still the same

Or do we have any activity which we can use to copy the complete json into the required form in web app,
Instead of using a TypeInto activity ?

here often simulateType did help in certain scenarios.
In some other cases, we did succeed with experiments on:

  • copying text to clipboard and pasting text from clipboard

we would exclude set Text Activity from options as the text has to be assigned to the value atttribute of the element and not to a text attribute

However as mentioned above, debug and check by using myJObject.toString.Replace("[","[[")

I think I commented on the previous question “Json update to Excel data”. Could you please check that and provide your suggestions?

Here is the question:
I was just verifying the invoke method,the values are converted to String.
After the Invoke Method,when I just put in a Log Message to see the Json data, it does not have the in it…
I tried the XAML shared by you with few modifications in the json file.

it is the same in this as well. see the display belowProcessing: IMG_20220121_184730__01.jpg…

Any suggestions here?

Let the two discussions clearly separated. This topic is scoped to the TypeInto issue.

  • set a breakpoint on the typeInto activity
  • debug the bot and get paused
  • open immediate panel and type in: myJObject.toString.Replace("[","[[")
    share the result from this with us
  • step forward within the debug and get executed the typeInto
  • share screenshot from the popuöated textfield with us

Keep in mind, when helping from remote you we are limited and cannot do inspections by our own. Therefore we do need your help and feedback.

I tried the steps.Put the Breakpoint at TypeInto. Please see the output below:

cannot use the results created in this way. Please redo it as described above

we do need the results from

  • immediate panel and not output panel. Just clear it before (right click on immediate panel content, slect clear all option
  • 2nd screenshot looks not like a textbox form a web page

Kindly note: timezone value is a JObject and not JArray. so we dont have [ ]

The below screenshot from the Immediate Panel

I added a array in the json and tired still the same issue.

is quite surprising the difference between immediate panel and result with missing [ ] after typeinto and the output

it looks like some confusion/mismatches. Also we can reduce the heavy ping-pong conversation when the development will be worked in a straightforward manner.

In such a case we would recommend making a small break and getting some distance and recreation. Once you will continue ensure the following:

  • clean up your code and remove any unneeded artifacts/variables…
  • do Not try to fix/edit/check too many things in parallel
  • use debugging and ensure that each processing step is as expected like, proper JSON string, proper JSON Serialization, proper update …

this concentrated work will help you to find out the issue

1 Like