![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
help :
faq :
home
|
||
Latest News:
|
latest topics : statistics |
Topic Title: How to speed up looping a large variable? Topic Summary: How-to speed up looping a variable by using Basic Script Created On: 07/12/2018 01:56 AM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
||||||||||
Hi there!
I have built an integration in which I use APIs in order to upload a file to a webpage. One of the responses that I get, the amount of data is huge (by normal loop, it takes currently 45 seconds to find a value that I need). I understood there is another way to speed up loop by writing a basic script, which I have no clue how to do that. Did some research, but couldn't find any examples applicable for my situation... and I need to improve the performance of this integration, due to large amount of data and files. Here's how my data looks like: %getDirectoriesResponse%: id:1647330,parentId:889630,name:FolderName,level:1 id:1647331,parentId:1647330,name:From,level:2 id:1647332,parentId:1647331,name:2018,level:3 id:1647333,parentId:1647332,name:2018-01,level:4 id:1647334,parentId:1647332,name:2018-02,level:4 id:1647335,parentId:1647332,name:2018-03,level:4 id:1647336,parentId:1647332,name:2018-04,level:4 id:1647337,parentId:1647332,name:2018-05,level:4 id:1647338,parentId:1647332,name:2018-06,level:4 id:1647339,parentId:1647332,name:2018-07,level:4 id:1647340,parentId:1647332,name:2018-08,level:4 So what I am trying to achieve here is finding the current month ID, based on the Folder name. How it works now: 1st loop: I loop through all data and check if one of the rows is ending with: "name:FolderName,level:1" (this row could be anywhere) If so, I return id:1647730, which I will be using in next loop 2nd loop: I loop through all data and check if one of the rows is ending with: parentId:1647330,name:From,level:2 If so, I return id:1647331, which I will be using in next loop 3rd loop: I loop through all data and check if one of the rows is ending with: parentId:1647331,name:2018,level:3 If so, I return id:1647332, which I will be using in next loop 4th loop: I loop through all data and check if one of the rows is ending with: parentId:1647332,name:2018-07,level:4 If so, I return id:1647339, which I am looking for ![]() Could someone help me build/write a basic script to achieve this? or perhaps there is another more eficient way? Thank you in advance!
|
||||||||||
|
||||||||||
![]() |
||||||||||
Today was a good day!
So, here's the work around discoverred: 1. Write the entire variable to a csv file 2. Read the csv and populate a dataset (dstemp), using as delimiter comma 3. Run following basic script: Sub Main For i=1 To dstemp.TotalRows If "name:FolderName" = dstemp(i).Column3 Then childrenLevel1=dstemp(i).Column1 Exit Sub End If Next End Sub and so on ![]()
Edited: 07/12/2018 at 05:43 AM by DorelPureca |
||||||||||
|
AutoMate Discussion
» AUTOMATE » AutoMate 10
»
How to speed up looping a large variable?
|
![]() |
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.