Skip to content
+1-888-319-3663

COMMUNITY FORUM

Global Variable not picked up by later task

Sherry asked 5 years ago
I have the DateTime task set to run before the map. It gets the current date/time and sets it as value of GlobalMessage. I have a message box that shows that it is set. Simple task.GlobalMessage = DateTime.Now messagebox.show(GlobalMessage) Return TrueThen I have the EventReader task on Map Fails. The first part of the task sets variable types and gets the correct log. The next part is to set startTime = GlobalMessage. Right before that, I inserted a message box to show the value of GlobalMessage. it is BLANK. The value from the first task has not been passed. I also added a message box to show the value of starttime after it is set to equal GlobalMessage, but the map never even gets that far. The task ends, telling me “Conversion from string” to type ‘Date’ is not valid. So it obviously can’t set starttime = the value of GlobalMessage, which it apparently thinks is blank now. How can I get the value of GlobalMessage to stick between the before the map task and the map fails task? Thanks.
Answers
Ethan Sorenson Staff answered 5 years ago
Sherry,
What version of SmartConnect are you using? version 20.17.0.11 does not work with Global Variables. If you are on that version please upgrade to 20.17.0.17. 
Ethan
Sherry replied 5 years ago

I am already on V 20.17.0.17

Ethan Sorenson Staff replied 5 years ago

Sherry,
Rather than using GlobalMessage to hold that value try creating a new Global Variable under the Maintenance tab in SmartConnect. Replace the references to GlobalMessage with your new variable, and see if it works then.

Sherry replied 5 years ago

That seems to work! Why? Thank you!

Ethan Sorenson Staff replied 5 years ago

GlobalMessage is a built in global variable and was likely being used for another process when you were trying to use it. I generally suggest using your own Global Variables whenever possible.


If you would like to submit an answer or comment, please sign in to the eOne portal.