Pass by Reference Variable is not getting set in TryParseExact method


#1

Scenario:

I have a date that is taken in input as string and have to store it in a DateTime variable. I have used the DateTime.TryParseExact method.
This method stores the result value in a variable that has to be passed as reference.
UiPath is not able to store teh value for this variable.

I am aware of the other method Parse exact, but it throws an error if the input string doesn’t conform with the specified format. I do not want an error to be thrown here.

Steps to reproduce:

sample xaml attached.
Execute it and it should give result as true and the converted date should be displayed instead of 0001/01/01

Current Behavior:

Result not getting stored in the result variable

Expected Behavior:

Result should get stored successfully in the result parameter.

Studio/Robot/Orchestrator Version:

Studio:2016.2.6192
Last stable behavior: unknown
Last stable version: unknown
OS Version: Win 7
Others if Relevant: (workflow, logs, .net version, service pack, etc):
Sample workflow attached.zzTest.xaml (7.8 KB)


#2

This might shed some light, although the topic is quite old I think it’s still relevant:

In short - WWF uses different allocation schemes (context) than traditional .Net.
For most common ones (f.e. dates) Microsoft has supplied some supplementary packages (check your available packages for Workflow Manager Activities and Microsoft.Activities.Extensions). For the rest you’ll need a combination of InvokeMethod, InvokeCode (if you have a version that supports it) and/or custom activities.


Academy 2 - Walkthrough – UiDemo - TryParse
How to check given date is in MM/DD/YYYY format