Multiple if condition make difficult to understand

I am using flow chart create a code using multiple if condition like inside if we have if else again in same if again if else so on as mentioned in screen shot.Is there any way we can create separate sequence for if else and call it
one suggest me for that you need to break the smaller module and invoke the code to main workflow one way of doing this or or use Boolean flags instead of using nested ifs

@Aditya10989

Use Switch activity instead of multiple IF conditions.

@lakshman thanks for reply may be you did understand my question please see the diagram which I have created Switch used in one condition multiple case so use switch case.if in my case inside if if else in this if one more if else again same if else inside this if else so on
inside if condition I got output according to output again if condition again got output according to output again again if condition got output according to output again if condition so on

can any one please help me like can we create function in this
eg in one function one input condition then I call this

Here you can do that in multiple ways @Aditya10989

You can drag multiple if conditions in a workflow within a if condition and within that, you can drag another. Or

Do onething, whatever the things you want to do in a if condition and else condition ,make them a seperate workflow and use a if condition and use invoke workflow to place everything in the condition based on your requirement.

If you want to change the arguments also, this is a better thing to do :slight_smile:

thanks for reply I create different work flow now I want to call how can I done can you please share me any sample code it is for me very helpful

Hey @Aditya10989,

your image of the process flow already looks like a neat sequence flow in a UiPath workflow.

What I usually do to keep my workflows organized and easily understandable is simple:

  1. Use Flowcharts instead of Sequences to make my sequence flows easy to follow
  2. Use Flow Decisions instead of If-Activities (prevent that nested If-Statement inception-thing)
  3. Build smaller modules in their own sequences (or better: Flowcharts :star_struck:) and invoke them in the main workflow - Use the Invoke Workflow activity or simply drag and drop the workflow from the project panel into the design panel.

I won’t give you a sample workflow though. You are smart, you can do this on your own. If all else fails, try the developer trainings in the academy. All of the steps above are explained in detail!

Cheers, Lukas

1 Like

in diagram this show neat and clean because I did not apply and logic and its not complete flow I need to apply 3 more condition

I don’t want code from you I just want to know if I create separate activity then how I can call in code

Just drag and drop the workflow from left pane to right pane to the required position @Aditya10989

Yes, you can.

  1. Create new sequence or flowchart
    grafik
  2. Drag and drop the workflow from the project panel to the design panel (as Hareesh pointed out already) :wink:
  3. Done!

this will drag all code you understand my requirement I think
eg in .net c#
public void abc()
{
apply the logic
.
.

}

then use abc() function name
now hope you will understand

I hope this helps :upside_down_face:

Main.xaml (9.6 KB)

Cheers, Lukas

now you send me code in your code you used Invoke ModuleA workflow Invoke ModuleB workflow flow decision I do not want this in my case only
Invoke ModuleA workflow
inside this if condition used then I got o/p use this o/p again use if condition and so on.Now I want seprate function for multiple if condition eg for 5 if condition 5 function then call in
Invoke ModuleA workflow
{
1()
2()
3()
4()
5()
}
public void 1()
{
if(a>50)
{
.
.
}
}
public void 2()
{
if(firstname=‘abc’)
{
.
.
}
}

What are you saying? I can’t understand.

I am saying I want to create 5 different function now I want to call this one by one.these all 5 function code in not in flow chart of my application it will create separate only function name is used in my code.

@lukasziebold you send me main.xaml now I changed in code main2.xaml just see my requirement please consider get text like function name and I called sequence1,sequence2,sequence3 in a sequenceMain (1).xaml (15.8 KB)

You want to invoke the same function again and again in the if or else condition right? @Aditya10989

Then do the same as mentioned above… drag the workflow to the required number of times into the main workflow based on your condition

I read your messages over and over again, but I really can’t understand what the problem is…

Do you mean you want to invoke several workflow files in a sequence? - Use several invoke workflow activities in a sequence.

Do you have more If-statements in these invoked workflows? - I recommend using Flowcharts and Flow Decisions to keep your sequence flow organized (see my first post).

Do you want to invoke code instead of invoking workflows? - Use Invoke Code or Invoke Method activities (search forum for examples).

Do you want to Get Text somewhere, then do something depending on what the Text is? - Use Flow Switch activity to handly different outcomes of Get Text.

Do you mean something totally different? - Try to explain your goal and your problem in simple words, ideally sentences…

Also I still recommend developer trainings. RPA is not that hard, but it does take some time to learn the basics :slight_smile:

Cheers, Lukas

I do not thing there is in UiPath anything like c#
public void abc()
{

}

Possibly you could substitute it by a workflow file / InvoikeWorkflow activity.
:frowning:

So this:

would look like this:
Workflow A
{
Invoke 1 workflow
Invoke 2 workflow
Invoke 3 workflow
}

Workflow 1
{
if(a>50) {…}
}

Workflow 2
{
if(firstname=‘abc’) {…}
}

Cheers