Setting up a Global Variable for Use in an Xlate

Clovertech Forums Cloverleaf Setting up a Global Variable for Use in an Xlate

  • Creator
    Topic
  • #122027
    Jeffkohl
    Participant

      Probably really simple but the documentation really is not there to show how to do this or an example

      Reading in a CSV file once a day and converting it to JSON.

      The first line of the CSV file are headings

      I am reading in the first value in the first line and want to store it in a global variable in the xlate so that each time I read in the csv file which only has 5 lines so 5 messages get generated I can re-use that value in other messages getting generated for that file

      Any help would be appreciated

       

    Viewing 0 reply threads
    • Author
      Replies
      • #122028
        Jim Kosloskey
        Participant

          You will need to use Tcl. In your Tcl code issue the gvsetvar command (search for gvsetvar in the User Doc). As I understand it the variable can be in-memory or be stored in a .ini file. Using gvsetvar only sets the in-memory value. If you would like the value to be more permanent, then I think you also need to do a gvsave (but be aware that saves ALL in-memory Global Variables to the .ini file).

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

      Viewing 0 reply threads
      • You must be logged in to reply to this topic.