damien
Posts: 0
Joined: Thu Dec 27, 2012 5:31 am

Add multiple items to database

My app gets API response from facebook that returns multiple posts from logged in user. how can I save all posts displayed on results page to tiggzi database?

Example response:

user id123 post1
user id123 post2
user id123 post3

I need to save all posts to database. There can be a different amount of responses each request.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Add multiple items to database

Hello,

Standard Tiggzi tools do not provide this, so you can write JavaScript code to do it.
We will search for the easiest solution.

Agon Bina
Posts: 0
Joined: Thu Oct 04, 2012 5:01 am

Add multiple items to database

I'd be interested to hear what's the best solution for this too. I am going to need this feature soon.

thanks!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Add multiple items to database

Hi,

To add multiple items to database you have to run Rest Service that adds item to DB several times.

Create a mapping in Rest Service from localStorage variables to Request parameters:
Image

Then run following JavaScript code to add item to DB:code
localStorage.setItem('phone', '555-11-99');
localStorage.setItem('completed', 'true');
createRequest.execute({});/code
("createRequest" is a Rest Service name on Data tab)

This JS code must be run in the cycle for each Facebook post.
And database queries will be executed in parallel (asynchronously).

Return to “Issues”