Page 1 of 1

SOLVED asynchronous, daily string array upload

Posted: Fri Apr 20, 2018 6:26 am
by litow
Reaching out to smarter people than me.

I have tried to setup a first pass for a ES2 saving scheme for my app. (thank you for making it so powerful and easy).
I got a basic example to work nicely.
But to rework and simplify the process to my needs, I would like to achieve the following.

1- Multiple users uploading a string to my sql server, at any given time.

2- Each upload to use the current date as a tag, ie: 20180420

3- As such, all entries for a given day to be stored under that tag as a string array, ie:
tag 20180420
user1,user2,user3,...

This would allow me to have multiple user upload under the same tag and easily collect the data back, by querying that tag.

Unless I missed it (or alternatives) I could not find an ES2 playmaker function which would allow me to add 1 array entry to an existing (or new) tag.
If I use UploadStringArray, that upload always overwrites what is already on the server.

I guess one way would be to download the sql data under that tag, add a new value to it, then upload it again.
But that means that if any other user does the same within that time frame, I may miss it, due to racing conditions.

Is there a way to achieve what I am after?

Re: asynchronous, daily string array upload

Posted: Fri Apr 20, 2018 9:48 am
by Joel
Hi there,

There's no way to update an array on the server without download it and re-uploading it.

Instead you would be better off saving each day as a different filename, rather than a different tag. Then it would be easiest to store the string as the tag, with an empty value.

Then you can use the Get Tags action to get all of the tags (strings) from a given filename (day).

All the best,
Joel

Re: asynchronous, daily string array upload

Posted: Sat Apr 21, 2018 1:38 am
by litow
Understood. Makes sense... thank you!