cancel
Showing results for 
Search instead for 
Did you mean: 

error in obtaining the value of workflow properties with UNITY API

Jorge_Herrera
Champ in-the-making
Champ in-the-making

I'm trying to get the value of a property created in workflow, and apparently it is not capturing it correctly, how could it be validated?

this is the code

-------------------args.SessionPropertyBag.TryGetValue(_propNumeroRevisionIn,out indice);
1 REPLY 1

Alex_French
Elite Collaborator
Elite Collaborator

A couple of things to check:


1) Are you looking for a Session Property or a Scoped Property?


A Scoped Property would be retrieved using args.PropertyBag, a Session Property using args.SessionPropertyBag


2) Does the type of your out variable "indice" make sense for the value in the property?


For example, if your property contains a string and your out variable is a long, I think TryGetValue() will just return false.


3) In a pinch, there is a way to loop through all Properties (within a specific property bag).


You can access the Property Bag using several different interfaces- I think IDictionary<string, object> is one. So you could do something like loop over the Keys, retrieve the Value, and write the .ToString() to the Diagnostics Console. That might help clear up if the Property value really isn't available, and it isn't some other technical detail.