using global variables

  • Last Post 4 weeks ago
  • Topic Is Solved
cristian ascencio posted this 5 weeks ago


Lately we´ve been building a definition with several  script rules inside. Most of them work with external datasource connection strings to the same  db. My question is:  ¿does flexicapture allows or supports somehow using global variables (for the connection string for example) wich could be used by any rule?


Thanks  anyone for the help!

Order By: Standard | Newest | Votes
Ekaterina posted this 4 weeks ago


Please use the Environment variable for this purpose. More details about it you may see in the “Environment variables” article in the Developer Help

cristian ascencio posted this 4 weeks ago

Hi.. thank you for taking the time to answering..

 i createad an ADO string connection EV. (as you can see in the attached image) 

 but. i´m kinda newby on this  so i haven´t been able to call that EV in my script rule .. 

 i would be very thankful with you if you could take a look to  the attached file where i explain how i am actually connecting to my data source. the idea is to " replace" all that connection parameters  with the  EV. i just dont get how to do it.


Thank you for your help!

Attached Files

Ekaterina posted this 4 weeks ago


The Environment Variables are also available on the level of IProject, so you may call them as

var testCon = FCTools.ScriptContext.Project.EnvironmentVariables.Get("test_con");

in the rules 


var testCon = Document.Batch.Project.EnvironmentVariables.Get("test_con"); in document processing scripts

  • Liked by
  • cristian ascencio
cristian ascencio posted this 4 weeks ago

Yeap! i tried that code and worked just perfect


Thanks 4 ur help!!