I need some help using type into activity for string

I have a process that requires to type into some application, but having some issues as the string has multiple lines with some special characters.
There are multiple line like this (around 10-12) :

IF(AND([//xxxxxx.xx] =“xxx-xx”, [//xxx-x]=“122-34”), “xx-xxx”,
IF(AND([//xx.xxx] =“xxxxxx”, [//xxxx]=“123-456”),“123345%”,
IF(AND([//xxx.xx] =“xxx”, [//xxx]=“1234-56”),“1234564%”,
IF(AND([//xxxx.x] =“xxx-xxx”, [//xxxxx]=“123-123”), “12345%”,

Please help. Thank you in advance !

@harsh2

You can use set text / simulate with type intoactivity

Or use type into with hardware events as well

Ideallys et text should suffice

Cheers

Hi @harsh2

To handle text that contains multiple lines and special characters in an automation process in UiPath, you can use a few approaches to ensure that the content is typed correctly in the target application.

Here are a few tips that may help:

1. Use the “Set Text” Activity:

If the field you are trying to insert text into allows direct input (e.g. a text field in an application window), you can use the Set Text activity instead of Type Into. The Set Text activity inserts the value directly, without the need to simulate typing, which avoids issues with special characters and multiple lines.

2. Use “Type Into” with Appropriate Options:

If the field does not support the use of Set Text and you need to use Type Into, make sure to enable the SendWindowMessages or SimulateType options. These options are designed to ensure that UiPath can type the text correctly, even when there are special characters or multiple lines involved.

My main problem here is that text it self has “” for example the text is like this “XXXX” and I want to type ““XXXX””.

Hi @harsh2

Fallow the step below. If I helped you, mark as solved

To type the string ““XXXX”” in UiPath and include the double quotes correctly, you need to use the escaping technique so that the quotes are recognized as part of the string and not as delimiters. In UiPath, you can do this by using two double quotes in a row (“”) for each quote you want to include in the string.

The image shows a sequence in a programming workflow where a string is assigned, concatenated with additional quotation marks, and displayed in a message box. (Captioned by AI)

Here is code:
Main.xaml (7.2 KB)

I am having issues while using assign :

I have multiple line like this.

@harsh2

instead of newline use \n and try

also I beleive issue is not with new line but with inverted comma not being escaped …except first and last repalce all with ""

Eg:

"If(""abc"")
If(""def"")"

cheers

cheers

Thank you ! This works perfectly !

1 Like

Hi, the previous error is resolved but when I am trying to use type into and set text I am having this error.

Type Into ‘document PART_FormulaTe…’: Special keys syntax error. Encountered invalid special key action at text position: 9.

@harsh2

Did you try hardware events?

Please show a screenshot of error and log message by printing the value

Cheers

Hi,

Yes I did tried that hardware event but it throw me the same error. Please find the attached screenshot.

@harsh2

check what is there in 9th position in text

cheers

I am just using one line now but still same error.

“IF(AND([//abcd.abcd] =”“abcd abcd”“, [//abcd] =”“A+”“), ““1.2345%””,”

Please advice. Thanks !

@harsh2

The error looks to be at //

Can you print the string and check how it looks

Cheers

Sure !

The image shows a logical function in a formula using "IF" and "AND" operators with conditions and values. (Captioned by AI)

Hi,

any idea what’s the solution for this ?

Thanks,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.