Auto Complete Variable with Default Value

Hi All,

Currently im working at automation for generate letter in word document.
I have had replace activity from Balareva to replace specific word with my variable data,
but i have issue with this type of document :

Issue : I need to replace field yellow field ‘…’ with variable data with same amount character

Before : .......... (10 Characters)

After : Name...... (10 Characters)

Anyone can help me to solve this?

Thankyou

Hi @aliaga

You can use the Replace Text in Document activity to replace the Specified text with the required text.

Check the below image for better understanding,

Note - 1. You have to install the UiPath.word.activities to use the activity.
2. You have to use this activity inside the word application scope activity.

Hope it helps!!

Hi @mkankatala ,

Thankyou for your reply, understand for that case,

my issue is in here :

Do you want to replace the dots with the data stored in the Variable right, If yes the replacement data should be very specific.

In your case, If the dots have same count it will replace whole dots with the data.

For example, If I have … 3 dots then give these 3 dots in the Search for field in the Replace Text in document activity. Pass the Variable in the Replace with field.

Hope you understand!!

If you are not understand then give me the more clarification. @aliaga

Hi @mkankatala ,

I need to replace dots value but not all dots replaced with variable.

Example :

Hello my name is .......... , Nice to meet you
Replaced become
Hello my name is Ali Aga... , Nice to meet you

in this case both .......... and Ali Aga... has same 10 Characters

Okay @aliaga

If the dot count is fixed then create a variable called Item and store the dots as String like

Item = ".........." -> It has 10 dots

After that Store the name in a Variable called Name

Name = "Mahesh"

Take the length of the Name variable and store in a Variable called Length it is Integer type.

Length = Name.Length

After that take an assign activity and write the below expression,

- Assign -> Name = Items.Replace(Item.Substring(0,Length),Name.ToString)

Check the below workflow for better understanding,

Hope you understand!!

Hi @mkankatala ,

Thankyou for your help, updated my version that work

1 Like

Thank you @aliaga
I hope you are satisfied with the solution, make mark it as solution to close the loop.

Happy Automation!!

Hello

Sounds like you already have a working solution from @mkankatala but can you just change the template and update the dots “…” to be something more unique like [REPLACE_1], [REPLACE_2] and [REPLACE_3]. This would be similar to the first 3 highlighted elements [Name], [Letter_No] and [Number].

This method works great with Replace Text in Document show in @mkankatala’s replies above.

Cheers

Steve

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