I have created a common email function in a process (Main.xaml) file, and I want to call this function from my main project whenever an email needs to be sent.
How can I accomplish this?
Also, will this approach work if I need other common logic functions that I want to call from the main project? How can I pass parameters between the main project and the common function?
You will have to use Invoke Workflow File activity for this. Also recommend you to Learn to use arguments between workflows as this is much important when you are invoking workflows. Follow this tutorial.
Create the email logic in a separate xaml file and call it with Invoke Workflow File. Define arguments in the common workflow and pass values from the main project. This same approach works for other reusable functions and lets you send parameters in and out.
Check:
If helpful, mark as solution. Happy automation with UiPath