How to retrieve variable value from one bot task to another

Hi, I have 2 bot tasks used in a business process, i want to retrieve value of variable assigned in first bot task in the second bot task.
below are my bot tasks.

<?xml version="1.0" encoding="UTF-8"?>
<config
	xmlns="http://web-harvest.sourceforge.net/schema/1.0/config"
	scriptlang="groovy">	
	<var-def name="nList"></var-def>	
	<var-def name="certIds">
	<database connection="jdbc:sqlserver://dfgdfgfVMgfB03:1433;databaseName=CertificationApp;user=qaUser;password=qaUser$"
		        jdbcclass="com.microsoft.sqlserver.jdbc.SQLServerDriver">	
		        <template>	        
				 Select A.CertID FROM [CertificationApp].[dbo].[CertificationDetail] A
				  inner join [CertificationApp].[dbo].[Exception] B
				  on A.CertID = B.CertID
				  where queueid = 3
				  and A.WithholdingYTDAmount is NULL
				  and A.CountryOfTaxResidency != 'USA'
				  and A.AssignedTo is NULL
				  and B.ExceptionJSON like '%Member not Declined%'
				</template>
			  </database>
	</var-def> 	
	<script><![CDATA[	
	  nList = certIds.size();
       println("I am talking about this-- " + nList)
      ]]></script>		
    <export include-original-data="true"></export>

</config>
--------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config" scriptlang="groovy">
<mail smtp-host="internal-smtp.unfcu.int"
      smtp-port="25"
      type="html"
      from="mpxxri@uuuu.com"
      reply-to="xpcri@uuuu.com"
      to="xpcri@uuuu.com"
      subject="Certapp Processing Status">  
      <template>
      Team: Bot Processed ${nList} Certapp requests.      
      </template>
      <mail-attach name="DNA.xls" mimetype="application/octet-stream">
              <file path="C:\Users\mxcxuri\DNA.xls" type="binary"/>
      </mail-attach>      
  </mail>
    <export include-original-data="true"></export>
</config>
![image|690x339](upload://zHkLE4Wf8jF8zhSa4PhIRF2DoPF.png)

Hi,

That’s exactly why the export tag exists ! https://kb.workfusion.com/display/WF/export
Also you should check the Workfusion academy to learn how to use those properly https://automationacademy.com/learn/login/index.php

2 Likes