Mapping nested results to database

This forum contains topics that were moved from Get Satisfaction
Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Mapping nested results to database

Post by Mark7294305 »

Hello Support
I am trying to mapping the results of a search from an api to my database. The results will return multiple items so I have to use the “” option to receive all of the required items. The returns work ok but when I try to save the items to the database, only one row is added to the database and the database fields are empty. How do I make this work?
Image Image Image

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Mapping nested results to database

Post by Alena Prykhodko »

Hi Mark,

[quote:]The returns work ok but when I try to save the items to the database, only one row is added to the database and the database fields are empty.[/quote]

How exactly do you save it?
What service do you use for this? Show us its settings and parameters.

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Mapping nested results to database

Post by Mark7294305 »

Hello Support
I have made some progress on this by following Max Katz’s Lesson 6 latest video. However I am only able to upload the first product I receive on the results
The rest service I connect to is
https://api-groceries.asda.com/api/it...
This is my configuration

  1. Create a Model (pic1)

  2. Create a storage variable (pic2)

  3. Create a get service (pic3)

  4. Map get results into storage model (pic4)

  5. Map storage model onto App page (pic5)

  6. When Add button on App page is clicked add results to database (pic6)

    (pic7) displays the results of “Map storage model onto App page (pic5)”
    (pic8) displays the results of “When Add button on App page is clicked add results to database (pic6)”
    Image Image Image Image Image Image Image Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Mapping nested results to database

Post by Yurii Orishchuk »

Hi Mark,

Unfortunatly you can not edit multiple objects with singe request.

Here is two solutions you can chose from:

  1. Use update service for each item(client part).
    1.2. Iterate through all your items.
    1.3. for each item you need to invoke update service.

  2. Single request with server code.
    2.1. Form needed array of items.
    2.2. Pass this array of items to server code.
    2.3. In server code you need iterate through all items and update all items one-by-one.

    Also it's hard interface for user - to edit multiple items. Do you sure you have/need this interface in your app?

    Regards.

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Mapping nested results to database

Post by Mark7294305 »

Hello Support
Thank you for you reply. The interface displayed above will be read only with a button to upload the item to database. So the user will not be able to select certain items. It will be "select and upload all item". Could you give me some examples of how to do this with server code?

Thanks

Post Reply