Using Functions in UIPath

There is a need to use a large piece of code several times.
Is it possible to write a function and call it as needed?
I will give an example from java.
//Function Description
function sum(a, b) {

  • sum = a + b;*
  • console.log(sum);*
    //Function call
    sum(a, b);


  1. pass value to function
  2. Process value
  3. return result
1 Like

Hey @Andrey_VIctorov

You can create a new project file → Click new and choose Sequence or Flowchart

Once the above is created you can create Arguments through which data can be passed

The workflow which you created now can be drag dropped into any other program files to call that as a function or use Invoke Workflow activity

Post that you can click on Import Args to send some data into file or get data out from it


1 Like

on the viewpoint of reusability we do have following options:

  • XAML files used within an invoke workflow file activity

  • Custom Libraries
    About Libraries

  • Custom Activities:
    Using The Activity Creator

  • nuget packages providing compiled artifacts

  • with some tricks: Actions

1 Like


We can achieve it using Func type as the following.


hi… can you help me what wrong for my variable


Can you try to set as the following.

Function(dt,b) "my result"

note: we cannot use True as definition of function.


omg, i just release it :smiley: thankyou sir

1 Like