Tools
Sign in
Login
Forum
Merge data in big collections
Forum
>
Scripting
>
Merge data in big collections
n/A
posted
on April 6, 2015
at 9:44 AM
Version
5.3.10
n/A
posted
on April 6, 2015
at 9:44 AM
Version
5.3.10
Hello Appway Community,
I have this data-model:
Indexed A $aes;
Indexed B $bes;
I need some sort of built-in function to do this kind of merge:
ForEach $a In $aes Do
ForEach $b In $bes Do
If $a.email == $b.email Then
$a.data := $b.data;
End
End
End
If there is no built-in function, then I need to speed up this script, as the 2 collections can get up to more than thousands of records.
Any ideas?
Thank you!
Mihail
Thomas Suter
replied
on April 9, 2015
at 11:06 AM
Thomas Suter
replied
on April 9, 2015
at 11:06 AM
If you want to solve this problem:
"I have two collections of items 'a' and 'b'. Each item has a "data" and an "email" property.
The email property is unique in each item collection.
I want to find items in the 'b' collection which have the same "email" as the items in the 'a' collection. For each of these items the 'b' item "data" property must be copied to the related 'a' item "data" property. "
then
I'd use a Named collection where the key is the email.
Then you travers the smaller collection.
1
Named Whatever $aes;
2
Named Whatever $bes;
3
Whatever $a;
4
For String $email In KEYS($bes) Do
5
$a:=$aes[$email];
6
If $a!=null Then
7
$a.data := $bes[$email].data;
8
End
9
End
Generally speaking:
If you have 1000ends of items consider implementing your function in Java.
If you have 100'000ends of items try using a database.
Cate
replied
on April 10, 2015
at 3:55 PM
Cate
replied
on April 10, 2015
at 3:55 PM
Hi Mihai,
Did you manage to do the merge?
Cate
n/A
replied
on April 10, 2015
at 5:15 PM
n/A
replied
on April 10, 2015
at 5:15 PM
Hi Cate,
I may need to go with the option to implement the function in Java.
Still I don't know how to do this, nor where i should get the java libs to compile the extension for Studio.
Thank you,
Mihail
n/A
replied
on April 20, 2015
at 11:13 AM
n/A
replied
on April 20, 2015
at 11:13 AM
Hi Mihai,
for the Java side you will need to get in touch with Appway solution engineers via the engagement leader following your initiative.
How large is your set of records?
n/A
replied
on April 20, 2015
at 12:26 PM
n/A
replied
on April 20, 2015
at 12:26 PM
Hi Mauro,
My set can get up to 4000 records, and data has to be merged and synchronized from different sources: Database and Integration Links.
Thank you,
Mihail
n/A
replied
on April 20, 2015
at 1:57 PM
n/A
replied
on April 20, 2015
at 1:57 PM
Ok then a Java function exposed via script language seems the way to go. We can continue the discussion about the best way to implement/get such a function if you contact me using mauro.labate [at] appway.com
Please
sign in
to add a reply
About this site
|
Terms of use
|
Privacy statement
|
Contact us
© 2025 Appway AG. All Rights Reserved.
I have this data-model:
I need some sort of built-in function to do this kind of merge:
If there is no built-in function, then I need to speed up this script, as the 2 collections can get up to more than thousands of records.
Any ideas?
Thank you!
Mihail