Error Accessing Array when Mapping

Hi, im mapping a service response this way:


and i'm getting this message error in the console:


can anyone know why and how to fix it?

Thanks,
1 person has
this problem
+1
Reply
  • Hello Carmelo,

    Please check the value of your Storage variable "locations", what value does it have?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Hi Sergi, thanks for the response.

    My storage variable object is this:


    and my service response is like this:
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Please check the exact value of that Storage variable and the service response on it's event "Success" with the JS code below:
    alert(JSON.stringify(data));
    alert(JSON.stringify(Apperyio.storage.Vendors_Branches.get()));

    Kindly let us know the result.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Hi Segiy, I tried this code that you told me, it results that the data that the service response have si diferent from the response of the service that was defined in the service (the 2nd photo is replied before), do you know maybe why this could be happening?

    This is some piece of what de data has in the service reponse:

    [{"ID":4324,"title":"Descuento en Pastel de Carne","pv_shop_name":"","pv_shop_description":"","_woo_vou_logo":false,"_woo_vou_how_to_use":"Aplican Restricciones.","_woo_vou_markerimage":false,"_woo_vou_website":"","_sku":"SALALIM001","_stock":"100.000000","_rewardsystempoints":"50","_woo_vou_product_start_date":"2017-02-24 00:00:00","_woo_vou_product_exp_date":"2017-07-31 00:00:00","_woo_vou_start_date":"","_woo_vou_end_date":"","link":"https://micupon.club/mx/producto/desc... en comida","pv_shop_name":"","pv_shop_description":"","_woo_vou_logo":false,"_woo_vou_how_to_use":"Aplican Restricciones.","_woo_vou_markerimage":false,"_woo_vou_website":"","_sku":"COAALIM001","_stock":"100.000000","_rewardsystempoints":"50","_woo_vou_product_start_date":"2017-02-24 00:00:00","_woo_vou_product_exp_date":"2017-07-31 00:00:00","_woo_vou_start_date":"","_woo_vou_end_date":"","link":"https://micupon.club/mx/producto/desc...% de descuento en comida","pv_shop_name":"","pv_shop_description":"","_woo_vou_logo":false,"_woo_vou_how_to_use":"Aplican Restricciones.","_woo_vou_markerimage":false,"_woo_vou_website":"","_sku":"ACAALIM001","_stock":"100.000000","_rewardsystempoints":"50","_woo_vou_product_start_date":"2017-02-23 00:00:00","_woo_vou_product_exp_date":"2017-07-31 00:00:00","_woo_vou_start_date":"","_woo_vou_end_date":"","link":"https://micupon.club/mx/producto/25-d...}

    Thanks,
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • It seems the response structure was changed. You can generate it automatically by clicking on the button "Import as Response" on the service test tab: https://docs.appery.io/docs/appbuilde...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated