Hello,
Am using a Type into activity. The text box is available in the screen and is indicated and highlighted properly. But, when the BOT is running, the following error is thrown. “Index was Outside the bounds of the array”.
Value used in Type Into activity : Variable1.Split(“By”)(1).Split(“(”)(1).Replace(“)”,“”)
Variable1 : “ModifiedByUser1”
Requesting for your help. Thank you
mkankatala
(Mahesh Kankatala)
January 30, 2024, 8:15am
2
Hi @shahidh.aqeel.shahul
There is no open and closed braces in the Input “ModifiedByUser1”
In the expression you have split with braces it will not work it will throw the exception.
From the Input what is your required output.
Hope it helps!!
Hi @mkankatala
The required output is: User1
Can you please help me with the expected expression.
Thank you…
Yoichi
(Yoichi)
January 30, 2024, 8:21am
4
HI,
It may be better to use the following expression.
System.Text.RegularExpressions.Regex.Match(variable1,"(?<=By).*").Value
Also share reason for using .Split(“(”)(1).Replace(“)”,“”)
part?
Regards,
mkankatala
(Mahesh Kankatala)
January 30, 2024, 8:25am
5
Okay @shahidh.aqeel.shahul
Then use the below one,
- Assign -> Input = "ModifiedByUser1"
- Assign -> Output = Input.Split("By").Last
Use the below workflow for String Manipulation,
Or
You can use the below regular expression -
- Assign ->Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=By).*").Value
Check the below workflow by using regex
Hope it helps!!
1 Like
system
(system)
Closed
February 2, 2024, 8:35am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.