How to transfer variable values from one bot to another bot in RPA Express 2.0.4?

I have seen the previous threads with same issue but I am unable to login to the links given there. That’s why I have repeated this question again. Can anyone please help with the issue.
Thanks in advance.

Hi @anandhan do you want to pass the value from one bot task to another bot task in a business process in Control Tower?

Yes. I want to pass the value from one bot task to another bot task. I couldn’t find a way to do that. And while designing the bots in studio can I pass the variables to a new bot task?

When you create recordings in the Studio, use the same variable names. When you publish the recordings to Control Tower and combine them in a business process, the values will be automatically passed from one bot task to the other if it uses the same variable.

Can I use the same variable from the first bot and modify the same variable value in second bot while designing in WorkStudio?
For Example, if I am getting a variable value with number data type from the first bot. Can I increment or modify anything of the variable from the first bot and update the variable with the modified results in the second bot in WorkStudio itself?

No, you will not be able to pass data between bots in the Studio. You can do it only in Control Tower if they are connected in one business process.

Can I update two different values in same variable from two different tasks?

Could you provide more details? I don’t exactly understand what you need to do.

Suppose I want to do the following steps in WorkStudio:

  1. Create Bot Task 1
  2. Define Variable A = 20 in Bot task 1.
  3. Create Bot Task 2.
  4. Update Variable A = A+10 in Bot Task 2.

Can I do these? In designing any Business Process I may need this case? How can I handle that then?

Yes, you can do it.
You can use Expression to change the value of the variable A in the second bot task.

But the initial value of the variable (20) cannot be passed from one bot task to the other in the Studio, only in Control Tower.

Wait I will check and let you know.

1 Like

Suppose I have created another Bot Task 3 which is connected to Bot Task 2. So now the value of A is updated to 30 in Bot Task 2. Now what if I want to get the initial value of A that was in task A in Bot Task 3(i.e. A = 20).

If you need to change the values, you can use different variables for this.

In Bot task 1, use variable A =20.
In Bot task 2, create a new variable B = A + 20. The value of A will stay the same.
In Bot task 3, use variable A again.

How to iterate through the indices of a data table and get the values one by one in WorkStudio?

Here are some useful links:

Thanks @ashapkina for the replies.

1 Like

Hope it was helpful :slightly_smiling_face:

Hi @ashapkina ,

When I upload to Control Tower… i was do how bot taks.

If I have the same variable name get error when I execute the CT. So i change all variable name that it was repeated. How can i move variables between process? I have Workfusion Studio v.2.0 and I can’t update it. Another issue that i have is … The decisions dont works properly when i put the process as bot taks, if i export the process as recorder to CT works fine.

Greetings

@ashapkina Hi, i have two bot tasks in the first bot tasks variable gets value assigned, I need to retrieve the value in the second bot task. After creating the BP with both bot tasks in Control Tower I am getting error
10.01.2019 17:46:33
ERROR
30
Step name ‘SendMailAttachments’ has failed. Reason: ’ Config line 10: template block groovy.lang.MissingPropertyException: No such property: nList for class: Script1_genScript_9’

Below are my both the 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>

Please let me know what I am doing wrong here.

Thanks and respect…