Is it possible to pass boolean values into activities?

Hi @Tracy_Schultz and Welcome to the Forum!

Theoretically you can yes, using either invoke code, invoke method with the WorkflowInvoker class.
This, however is very tedious and quite edgy from a reverse engineering perspective

Here is an example using Invoke code with the simplest possible example (Message box activity) setting the Topmost. You can try to change to TopMost boolean and see that it is applied.

Note that I surrounded my Invoke code with a TryCatch to get the proper exception message.

InvokeActivity.xaml (9.7 KB)

As you can see on this example, you will need to fill all Arguments according to their types with InArgument(Of T) objects so the activity will work. Then you can Invoke it via the Workflow invoker.

For your case, your code inside the Invoke would look like bellow, but it will be tricky to fill as it requires many arguments.

 Dim activity As UiPath.Mail.Exchange.Activities.GetExchangeMailMessages = New UiPath.Mail.Exchange.Activities.GetExchangeMailMessages()
activity.Server = New InArgument(Of String)("123")
activity.Password = New InArgument(Of String)("123")
activity.IsBodyHtml = False
'etc
WorkflowInvoker.Invoke(activity)   

Well, it would be simpler if this idea would come true so GoGo upvote :slight_smile:

Cheers

1 Like