@Samraat_Maharjan1 ,
1.Use âGet Textâ Activity to Get the Text (3+3)
2.Then use assign activity to seperate both Values
FirstNumber = Split("YourRetrivedText","+")(0)
SecondNumber= Split("YourRetrivedText","+")(1)
3.Then Use another Assign activity to add these two numbers
Sum= Cint(FirstNumber)+Cint(SecondNumber)
Note:Sum is of type Integer
4.Then type into the SUm into Captcha
Regards,
I canât select 3+3 only What is also get attached while I tried to capture
- Use get text â>str1
- Assign -->text = str1.Substring(str1.IndexOf("is ")+3).Trim
- Assign -->num1 = convert.ToInt32(split(text,"+"c)(0))
- Assign -->num2 = convert.ToInt32(split(text,"+"c)(1))
- TypeInto -->num1+num2
Regards,
@Samraat_Maharjan1 ,
You can make a small change while splitting try this
FirstNumber = Split(Split("YourRetrivedText","What is ")(1)
,â+â)(0)
SecondNumber= Split((âYourRetrivedTextâ,â+â)(1)
Regards,
Hi @Samraat_Maharjan1 ,
After getting the whole text, use the substring function to get only the expression part. Try the following:
new DataTable().Compute(StringVariable.Substring(8),nothing)
Regards,
Expression Activity type âVisualBasicValue`1â requires compilation in order to run. Please ensure that the workflow has been compiled⌠Itâs getting this error. What do I put in âYourRetrivedTextâ in this section? is this is a output of gettext
@Samraat_Maharjan1 ,
The retrieved text should contain âWhat is 3+3â
I have Mentioned that just for your reference
Please replace the âYourRetrivedTextâ with the Variable which is the output of the Get Text Activity.
Regards,
@vishal.kp
new DataTable().Compute(StringVariable.Substring(8),nothing) Can you explain this code a bit. Should I print this on log message to check?
Itâs getting error. System.Data.EvaluateException: Cannot find column [What].
Yes you can use this in log message,
new DataTable().Compute(StringVariable.Substring(8),nothing).toString
Regards,
@Samraat_Maharjan1 ,Can you display the value of StringVariable.Substring(8)
Regards,
Split(Split(âWhat is 4+1â)(1),â+â)(0) So this will be my code in the firstnumber?
and Split(âWhat is 4+1â,â+â)(1) in the SecondNumber
Can I replace âWhat is 4+1â with the output value of get text which is retrievedtext
@vishal.kp here StringVariable is the output of get text, right?
@vishal.kp Yes, I got this value " What is 4+1"
Yes @Samraat_Maharjan1 it is the get text output,
Suppose your full text is What is 3+3, then the substring(8) function will give you only 3+3 from that string, which should be passed to the expression I have provided above.
Regards,
@Samraat_Maharjan1 ,
Yes.
FirstNumber = Split(Split("What is 4+1","What is ")(1)
,â+â)(0)
SecondNumber= Split("What is 4+1","+")(1)
Now you just pass the variable of Get text activity in place of âWhat is 4+1â
Regards,
will this code works if itâs two digits say 10+12?
@Jithesh_R . Itâs giving me this error. Expression Activity type âVisualBasicValue`1â requires compilation in order to run. Please ensure that the workflow has been compiled.