Page 1 of 1

Mapping nested results to database

Posted: Thu Mar 26, 2015 10:09 pm
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


Mapping nested results to database

Posted: Fri Mar 27, 2015 12:23 pm
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.


Mapping nested results to database

Posted: Fri Mar 27, 2015 3:14 pm
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


Mapping nested results to database

Posted: Mon Mar 30, 2015 4:46 am
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.


Mapping nested results to database

Posted: Wed Apr 01, 2015 3:26 pm
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