How can I get the value

I have here the IF_statement_Stoat.xaml and there is a argument called stoatResult (out) then in my STOAT.xaml I used to invoke the arguments stoatResult (out) then in my main project I invoke the STOAT.xaml and try to get the value of stoatResult via Message Box. For your assistance. What is the proper used of IN/OUT.

Thanks,
Ricky

1 Like

send your xaml file.

@rtablate,

As a best practice do not use Arguments and Variables with same naming format.

So here you need to change your variable name stoatResult to some different name.

Check and change this in all the 3 XAMLs and try again.

Hi guys,

How to split String ?
The String format is below
bb/aa+CC

I want to take output
/
+
using For each

Use Regular Exp in Matches Activity : [A-Za-z]…try this … let me know

Can u please elaborate. I did not get u

Can u please elaborate. I did not get u

@rajesh_sappa,

Welcome to UiPath Community!.

If you dont mind please start a new thread.

and there is a .net built in function called string split. you can use it to split the strings using characters or strings.

For more information check this link.

Please refer the screenshot:

and

Awesome
usually there are four types of argument direction
In – the argument can only be used within the given project.
Out – the argument can be used to pass data outside of a given project.
In/Out – the arguments can be used both within and outside of a given project.
Property – not currently used.

and usually while naming the arguments mention this direction as well so that we wont find difficult to identify which is variable and which is argument
like this in your case
out_stoatResult is your argument
where stoatResult is your variable

this will avoid confusion and kindly try with this and let know for any queries or clarification

Cheers @rtablate

Hi
welcome to uipath community
for this string input
str_input = “bb/aa+CC”

the output would be like this
str_output = str_input.Replace(“/”,“”).Replace(“+”,“”)
or with split method
str_output = String.Join(“”,Split(String.Join(“”, Split(str_input,“/”)),“+”))

Cheers @rajesh_sappa

So is it safe to used the “In/Out”? What do you mean by project is it the xaml file? transferring of argument from one project to another. Just got confuse. Thanks!

1 Like

no buddy unless we need to intentionally,
we can use IN if its going to be used in that xaml alone i.e., that workflow alone
or OUT if we need that to be used in other workflows as well

Project is that workflow or that xaml where we are creating this arguments

yah
no worries let me explain
usually to share a value within a workflow or within a xaml then we will be using Variables
but if we want that values to be used in other workflows as well or other xaml from the current xaml, then we need to declare ARGUMENTS in the xaml with OUT Type
or if we have a xaml A and we want the arguments or others variables outside the xaml A then we need to create arguments with type IN and pass those variables as input value while invoking the xaml A with INVOKE WORKFLOW FILE activity

Cheers @rtablate

I got what u have explained. Thank you
but what if operates changes each time like bb-aa*cc

Then in that’s case we can use REGEX like this
With expression
[a-zA-Z0-9]+ in the MATCHES ACTIVITY with the string input passed
—get the output with a variable named out_matches
—now use a FOR EACH activity and pass the above variable out_matches as input and change the type argument as System.Text.RegularExpressions.Regex
—inside the loop use a writeline activity like this
item.ToString

Cheers @rajesh_sappa

Thank you. it worked for me.

I am getting a each arthmetic operator in for each but now how to use that operator to split and get the result.
For ex: I got a result with Vari1=+
then I am splitting with Vari2 = Split.("Vari1"c) but encountering an error ‘character constant must contain exactly one character’

can you please help me out with this

1 Like

This will give us actually the value after siting the string from those delimiters and that can be obtained within the for each loop one by one
Or if we want without looping we can mention the index position where it starts from 0 for the first splitted element

Cheers @rajesh_sappa

Can u please check below and help me out

1 Like

May in know what is requirement in the last image
With sequence of activities
Cheers @rajesh_sappa

String = (Automate1+Automate2*Automate3/Automate1)
I want to get the operators from String and need to split using operators and then need to follow other steps like inserting other values based on result