Pass the structure attribute to an entity

Pass the structure attribute to an entity

  

how can I pass the structure attribute to the entity I created?

Hi Wensen,


Can you be a bit more explicit in what you are trying to do?


Regards,
João Rosado

João Rosado wrote:

Hi Wensen,


Can you be a bit more explicit in what you are trying to do?


Regards,
João Rosado

Hi João Rosado,

Thanks for your response. What I want to achieve is below:

First , I have got some data from another system using "REST API"

These data were showed as a form as array(json) in the structure, for example, the top layer is "PostRestResponse", next layer is "Object", next layer is "Person__"  and the last layer is "Field"

Then I use a "ListAppend" to store the values of "Friendlyname" and "Email" in the Field,Now I want to transfer the values of "Friendlyname" and "Email" to the entity "Person"  that I created so that I can create a "Search form" or something else easier later on. 


How can I fulfill it? Thanks

Is that Objects attribute if type "Object" or "List of Object"?

The Object structure looks really strange with all the __2, __5, ...

Can you show how the json looks like?

João Rosado wrote:

Is that Objects attribute if type "Object" or "List of Object"?

The Object structure looks really strange with all the __2, __5, ...

Can you show how the json looks like?

The whole response json data is below:


{
  "objects": {
    "Person::2": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "2",
      "fields": {
        "friendlyname": "Anna Gavalda",
        "email": "gavalda@it.com"
      }
    },
    "Person::5": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "5",
      "fields": {
        "friendlyname": "Gustave Flaubert",
        "email": "flaubert@it.com"
      }
    },
    "Person::6": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "6",
      "fields": {
        "friendlyname": "Jean Cocteau",
        "email": "cocteau@it.com"
      }
    },
    "Person::8": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "8",
      "fields": {
        "friendlyname": "Jean-Paul Sartre",
        "email": "sartre@it.com"
      }
    },
    "Person::9": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "9",
      "fields": {
        "friendlyname": "Jules Verne",
        "email": "vernes@it.com"
      }
    },
    "Person::10": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "10",
      "fields": {
        "friendlyname": "Marguerite Duras",
        "email": "duras@it.com"
      }
    },
    "Person::13": {
      "code": 0,
      "message": "",
      "class": "Person",
      "key": "13",
      "fields": {
        "friendlyname": "Victor Hugo",
        "email": "hugo@it.com"
      }
    }
  },
  "code": 0,
  "message": "Found: 7"
}


I've similar needs.

Cannot update the entity with the REST results


the json:

{
  "results": [
    {
      "gender": "female",
      "name": {
        "title": "mrs",
        "first": "saana",
        "last": "nevala"
      },
      "location": {
        "street": "7969 tahmelantie",
        "city": "urjala",
        "state": "southern savonia",
        "postcode": 57012
      },
      "email": "saana.nevala@example.com",
      "login": {
        "username": "orangefrog320",
        "password": "bobbob",
        "salt": "uWvaZ97g",
        "md5": "0d61b7adc9948e43bfc339f27027b2c7",
        "sha1": "4e6b0224aac4b2b3eccce737d231506513f7ecae",
        "sha256": "a09f66774f259530e9c80e1f833a995442f0b000eb20823e070226810183ed00"
      },
      "dob": "1960-11-19 02:06:03",
      "registered": "2002-08-04 18:14:37",
      "phone": "03-998-093",
      "cell": "041-809-00-60",
      "id": {
        "name": "HETU",
        "value": "1660-656J"
      },
      "picture": {
        "large": "https://randomuser.me/api/portraits/women/84.jpg",
        "medium": "https://randomuser.me/api/portraits/med/women/84.jpg",
        "thumbnail": "https://randomuser.me/api/portraits/thumb/women/84.jpg"
      },
      "nat": "FI"
    },
    {
      "gender": "female",
      "name": {
        "title": "mrs",
        "first": "deniz",
        "last": "arslanoglu"
      },
      "location": {
        "street": "6012 anafartalar cd",
        "city": "Izmir",
        "state": "sivas",
        "postcode": 49158
      },
      "email": "deniz.arslanoglu@example.com",
      "login": {
        "username": "tinyrabbit972",
        "password": "blood",
        "salt": "YnfKpfjz",
        "md5": "5006bef1d81d2ccfae2b261a2b58df48",
        "sha1": "8196aaff3f86753c80d5689a513ec063fbdbc408",
        "sha256": "7de3f05bce32ccdc5a00c33be71f5a36c66637ad3239b6b8dd453394392d17e4"
      },
      "dob": "1988-10-04 14:16:17",
      "registered": "2007-11-30 17:08:37",
      "phone": "(337)-387-4538",
      "cell": "(813)-375-6919",
      "id": {
        "name": "",
        "value": null
      },
      "picture": {
        "large": "https://randomuser.me/api/portraits/women/67.jpg",
        "medium": "https://randomuser.me/api/portraits/med/women/67.jpg",
        "thumbnail": "https://randomuser.me/api/portraits/thumb/women/67.jpg"
      },
      "nat": "TR"
    },
    {
      "gender": "male",
      "name": {
        "title": "mr",
        "first": "marcus",
        "last": "jackson"
      },
      "location": {
        "street": "5677 pt chevalier road",
        "city": "lower hutt",
        "state": "manawatu-wanganui",
        "postcode": 54258
      },
      "email": "marcus.jackson@example.com",
      "login": {
        "username": "lazyduck768",
        "password": "shodan",
        "salt": "g442Fe9d",
        "md5": "136d13d87feeb46936e29bcc341133b2",
        "sha1": "83ad61232db1be3e9b737cc68d0d56c21135641d",
        "sha256": "041b640271cac2a48c742b15ba149ea7dc564b7b91b43183eb505e7815f6d8bd"
      },
      "dob": "1973-11-29 01:58:07",
      "registered": "2014-10-25 03:39:13",
      "phone": "(579)-902-6783",
      "cell": "(647)-705-7394",
      "id": {
        "name": "",
        "value": null
      },
      "picture": {
        "large": "https://randomuser.me/api/portraits/men/79.jpg",
        "medium": "https://randomuser.me/api/portraits/med/men/79.jpg",
        "thumbnail": "https://randomuser.me/api/portraits/thumb/men/79.jpg"
      },
      "nat": "NZ"
    },
    {
      "gender": "female",
      "name": {
        "title": "ms",
        "first": "enni",
        "last": "wainio"
      },
      "location": {
        "street": "7747 korkeavuorenkatu",
        "city": "vihanti",
        "state": "pirkanmaa",
        "postcode": 22681
      },
      "email": "enni.wainio@example.com",
      "login": {
        "username": "ticklishbird993",
        "password": "wp2003wp",
        "salt": "I3R8fBaR",
        "md5": "00c086ab4ebfbbd7e3d1a859262e6f05",
        "sha1": "979fcd5c32433dac3895ee54e6327db196bcfa24",
        "sha256": "19768537b01c839175cb6ea1fd780528fa8562b21e956de6610630923d8a5b1c"
      },
      "dob": "1987-08-20 06:05:13",
      "registered": "2009-04-08 07:56:34",
      "phone": "07-236-828",
      "cell": "042-544-29-50",
      "id": {
        "name": "HETU",
        "value": "1187-852T"
      },
      "picture": {
        "large": "https://randomuser.me/api/portraits/women/87.jpg",
        "medium": "https://randomuser.me/api/portraits/med/women/87.jpg",
        "thumbnail": "https://randomuser.me/api/portraits/thumb/women/87.jpg"
      },
      "nat": "FI"
    }
  ],
  "info": {
    "seed": "c982f58963feba5d",
    "results": 4,
    "page": 1,
    "version": "1.1"
  }
}

Tim,

You simply CAN'T get a LIST of nested structures and try to save it to a record using the CreateOrUpdate entity action.

First, this action (and also the Create and the Update ones), only accept a SINGLE record. Your response is a LIST.

Second, your entity require records from different structures. An Entity can accept basically only "basic/identifier" types.

So, the solution is to have a Local variable of the same type of the Entity, than you ITERATE through your list, in it you use an Assign to assign the desired values from the response to the local variable and than use the CreateOrUpdate (or Create) action to save a single record (using the local variable as source), on each step.

Cheers,
Eduardo Jauch

#Eduardo, thanks for the insight! I'll poke around with local variables.

Are you familiar with Exercise2 "Mobile App" from the OutSystems overview training?
It's why I thought I was on the right track.
It also has a one-to-one entity/structure and also returns a list but does not iterate nor use local variables.

Clearly I am very, very new at this (just finished the overview training).  Can you explain why the exercise works and mine doesn't - 'cause they seem very similar to me.

Here's the exercise elements:



The REST Results (JSON):
{    "Id": 2,    "ProductName": "Amazon Echo",    "Picture": "https://www.muzzley.com/uploads/devices/main_56f44bc87570537d86229100.png",    "Category": "Voice",    "ProductDescription": "Use your voice to control your Muzzley devices.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56f44bc87570537d86229100.png",    "Price": 151,    "DistributorPhone": 35193768322.0,    "QuantityStock": 102  },  {    "Id": 21,    "ProductName": "Automaticant",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f1736cab5e7338216387.png",    "Category": "Automotive",    "ProductDescription": "Turn your car into a connected car and enhance your driving experience.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f1736cab5e7338216387.jpg",    "Price": 170,    "DistributorPhone": 35193768341.0,    "QuantityStock": 67  },  {    "Id": 57,    "ProductName": "Beurer AS 80",    "Picture": "https://www.muzzley.com/uploads/devices/main_571551d359aa606994359a25.png",    "Category": "Health & Fitness",    "ProductDescription": "This activity sensor continuously tracks your physical activity and monitors quality of sleep.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_571551d359aa606994359a25.png",    "Price": 206,    "DistributorPhone": 35193768377.0,    "QuantityStock": 59  },  {    "Id": 56,    "ProductName": "Beurer BF 700",    "Picture": "https://www.muzzley.com/uploads/devices/main_571554e859aa606994359a27.png",    "Category": "Health & Fitness",    "ProductDescription": "Track your measurements and body data at home and on the move.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_571554e859aa606994359a27.png",    "Price": 205,    "DistributorPhone": 35193768376.0,    "QuantityStock": 78  },  {    "Id": 55,    "ProductName": "Beurer BM 85",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715544059aa606994359a26.png",    "Category": "Health & Fitness",    "ProductDescription": "Check your blood pressure anytime, anywhere.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715544059aa606994359a26.png",    "Price": 173,    "DistributorPhone": 35193768375.0,    "QuantityStock": 80  },  {    "Id": 9,    "ProductName": "Connected by TCP",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001d60215708f9755113e6.png",    "Category": "Lighting",    "ProductDescription": "Manage your lighting locally or from anywhere in the world through the internet.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001d60215708f9755113e6.png",    "Price": 173,    "DistributorPhone": 35193768329.0,    "QuantityStock": 139  },  {    "Id": 10,    "ProductName": "Connected Cree® LED Bulb",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001e77215708f9755113ec.png",    "Category": "Lighting",    "ProductDescription": "Automate your lamps from anywhere for the perfect environment.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001e77215708f9755113ec.png",    "Price": 159,    "DistributorPhone": 35193768330.0,    "QuantityStock": 97  },  {    "Id": 62,    "ProductName": "Easybulb",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f3716cab5e733821638b.png",    "Category": "Lighting",    "ProductDescription": "A smart light bulb that lasts up to 25 years, controllable from anywhere.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f3716cab5e733821638b.png",    "Price": 211,    "DistributorPhone": 35193768382.0,    "QuantityStock": 123  },  {    "Id": 5,    "ProductName": "ecobee3",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605eade6cab5e733821637b.png",    "Category": "Thermostats",    "ProductDescription": "ecobee3 is an Apple HomeKit enabled smart thermostat with wireless remote sensors.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605eade6cab5e733821637b.png",    "Price": 169,    "DistributorPhone": 35193768325.0,    "QuantityStock": 80  },  {    "Id": 60,    "ProductName": "Egardia Alarm System",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605eff26cab5e7338216381.png",    "Category": "Alarms",    "ProductDescription": "A smart all-in-one wireless alarm system to protect your home against burglary, fire and water damage.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605eff26cab5e7338216381.png",    "Price": 209,    "DistributorPhone": 35193768380.0,    "QuantityStock": 123  },  {    "Id": 61,    "ProductName": "Egardia Smart Plug",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605ef9d6cab5e7338216380.png",    "Category": "Dimmers, Switches & Outlets",    "ProductDescription": "Plugs with auto switch on/off, depending on your alarm system settings and schedule.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605ef9d6cab5e7338216380.png",    "Price": 210,    "DistributorPhone": 35193768381.0,    "QuantityStock": 52  },  {    "Id": 13,    "ProductName": "FitBit Alta",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715567e59aa606994359a2a.png",    "Category": "Health & Fitness",    "ProductDescription": "It automatically recognizes and records exercises for you, so you can keep track of your workouts without ever pushing a button.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715567e59aa606994359a2a.png",    "Price": 162,    "DistributorPhone": 35193768333.0,    "QuantityStock": 77  },  {    "Id": 27,    "ProductName": "FitBit Aria",    "Picture": "https://www.muzzley.com/uploads/devices/main_571559d459aa606994359a30.png",    "Category": "Health & Fitness",    "ProductDescription": "Tracks weight, body mass index (IBM), lean mass and body fat percentage.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_571559d459aa606994359a30.png",    "Price": 176,    "DistributorPhone": 35193768347.0,    "QuantityStock": 127  },  {    "Id": 26,    "ProductName": "FitBit Blaze",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715589a59aa606994359a2e.png",    "Category": "Health & Fitness",    "ProductDescription": "Track your workouts, monitor your performance stats and gauge your progress.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715589a59aa606994359a2e.png",    "Price": 175,    "DistributorPhone": 35193768346.0,    "QuantityStock": 86  },  {    "Id": 11,    "ProductName": "FitBit Charge",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715559c59aa606994359a28.png",    "Category": "Health & Fitness",    "ProductDescription": "Track steps, distance, calories burned, floors climbed and active minutes.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715559c59aa606994359a28.png",    "Price": 160,    "DistributorPhone": 35193768329.0,    "QuantityStock": 21  },  {    "Id": 16,    "ProductName": "FitBit ChargeHR",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715582359aa606994359a2d.png",    "Category": "Health & Fitness",    "ProductDescription": "Track workouts, heart rate, distance, calories burned, floors climbed, active minutes and steps.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715582359aa606994359a2d.png",    "Price": 165,    "DistributorPhone": 35193768336.0,    "QuantityStock": 127  },  {    "Id": 12,    "ProductName": "FitBit Flex",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715560759aa606994359a29.png",    "Category": "Health & Fitness",    "ProductDescription": "Track steps, distance, calories burned, active minutes, hourly activity and stationary time.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715560759aa606994359a29.png",    "Price": 161,    "DistributorPhone": 35193768332.0,    "QuantityStock": 97  },  {    "Id": 15,    "ProductName": "FitBit One",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715572359aa606994359a2b.png",    "Category": "Health & Fitness",    "ProductDescription": "Monitor how well and how long you sleep and wake with a silent alarm.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715572359aa606994359a2b.png",    "Price": 164,    "DistributorPhone": 35193768335.0,    "QuantityStock": 89  },  {    "Id": 25,    "ProductName": "FitBit Surge",    "Picture": "https://www.muzzley.com/uploads/devices/main_5715595959aa606994359a2f.png",    "Category": "Health & Fitness",    "ProductDescription": "See distance, pace, split times, elevation climbed and review routes.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5715595959aa606994359a2f.png",    "Price": 174,    "DistributorPhone": 35193768345.0,    "QuantityStock": 29  },  {    "Id": 14,    "ProductName": "FitBit Zip",    "Picture": "https://www.muzzley.com/uploads/devices/main_571557ac59aa606994359a2c.png",    "Category": "Health & Fitness",    "ProductDescription": "Track steps, distance, calories burned and active minutes.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_571557ac59aa606994359a2c.png",    "Price": 163,    "DistributorPhone": 35193768334.0,    "QuantityStock": 67  },  {    "Id": 64,    "ProductName": "Futlight",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605fbe86cab5e733821638c.png",    "Category": "Lighting",    "ProductDescription": "WiFi-enabled smartphone-controlled LED bulb.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605fbe86cab5e733821638c.png",    "Price": 213,    "DistributorPhone": 35193768384.0,    "QuantityStock": 51  },  {    "Id": 23,    "ProductName": "Green IQ Smart Garden Hub",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f1266cab5e7338216386.png",    "Category": "Garden",    "ProductDescription": "GreenIQ Smart Garden Hub cuts your water consumption by 50%.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f1266cab5e7338216386.png",    "Price": 172,    "DistributorPhone": 35193768343.0,    "QuantityStock": 3  },  {    "Id": 6,    "ProductName": "Honeywell Lyric Thermostat",    "Picture": "https://www.muzzley.com/uploads/devices/main_576a61f9b2ae6d3f62028030.png",    "Category": "Thermostats",    "ProductDescription": "Whether it%u2019s hot summer or cold winter, the Lyric provides the right temperature control for your connected home.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_576a61f9b2ae6d3f62028030.png",    "Price": 170,    "DistributorPhone": 35193768326.0,    "QuantityStock": 32  },  {    "Id": 54,    "ProductName": "iHealth Blood Pressure Monitor",    "Picture": "https://www.muzzley.com/uploads/devices/main_569991c92b3fcd9e19877da2.png",    "Category": "Health & Fitness",    "ProductDescription": "Track your blood pressure with this no hassle monitor anytime, anywhere.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569991c92b3fcd9e19877da2.png",    "Price": 172,    "DistributorPhone": 35193768374.0,    "QuantityStock": 125  },  {    "Id": 49,    "ProductName": "iHealth Blood Pressure Wrist Monitor",    "Picture": "https://www.muzzley.com/uploads/devices/main_569991702b3fcd9e19877da1.png",    "Category": "Health & Fitness",    "ProductDescription": "Check your blood pressure with this convenient, reliable and stylish wrist monitor.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569991702b3fcd9e19877da1.png",    "Price": 198,    "DistributorPhone": 35193768369.0,    "QuantityStock": 76  },  {    "Id": 53,    "ProductName": "iHealth Core",    "Picture": "https://www.muzzley.com/uploads/devices/main_569991002b3fcd9e19877da0.png",    "Category": "Health & Fitness",    "ProductDescription": "A beautifully designed scale that provides a complete assessment of your body composition.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569991002b3fcd9e19877da0.png",    "Price": 171,    "DistributorPhone": 35193768373.0,    "QuantityStock": 98  },  {    "Id": 51,    "ProductName": "iHealth Edge",    "Picture": "https://www.muzzley.com/uploads/devices/main_569990702b3fcd9e19877d9e.png",    "Category": "Health & Fitness",    "ProductDescription": "Track your activity goals with a tracker that can be worn on your wrist like a watch or on your hip with the clip.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569990702b3fcd9e19877d9e.png",    "Price": 169,    "DistributorPhone": 35193768371.0,    "QuantityStock": 117  },  {    "Id": 52,    "ProductName": "iHealth Lite",    "Picture": "https://www.muzzley.com/uploads/devices/main_569990192b3fcd9e19877d9d.png",    "Category": "Health & Fitness",    "ProductDescription": "Records your weight and BMI, and supports up to 400 lbs.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569990192b3fcd9e19877d9d.png",    "Price": 170,    "DistributorPhone": 35193768372.0,    "QuantityStock": 30  },  {    "Id": 50,    "ProductName": "iHealth Wireless Body Analysis Scale",    "Picture": "https://www.muzzley.com/uploads/devices/main_56998f8a2b3fcd9e19877d9c.png",    "Category": "Health & Fitness",    "ProductDescription": "Create a personal weight goal with timeline and the app will help you keep track of your progress.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56998f8a2b3fcd9e19877d9c.png",    "Price": 168,    "DistributorPhone": 35193768370.0,    "QuantityStock": 73  },  {    "Id": 48,    "ProductName": "iHealth Wireless Pulse Oximeter",    "Picture": "https://www.muzzley.com/uploads/devices/main_56998ef02b3fcd9e19877d9b.png",    "Category": "Health & Fitness",    "ProductDescription": "A great and reliable way to spot-check your blood oxygen saturation (SpO2) and pulse rate.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56998ef02b3fcd9e19877d9b.png",    "Price": 197,    "DistributorPhone": 35193768368.0,    "QuantityStock": 38  },  {    "Id": 40,    "ProductName": "Insteon ceiling fan and light controller (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605ef296cab5e733821637e.png",    "Category": "Lighting",    "ProductDescription": "FanLinc is a dual-load responder acting as a light fixture dimmer and also as a 4 speed fan controller.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605ef296cab5e733821637e.png",    "Price": 189,    "DistributorPhone": 35193768360.0,    "QuantityStock": 90  },  {    "Id": 46,    "ProductName": "Insteon Dimmer Switch (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f0f46cab5e7338216384.png",    "Category": "Lighting",    "ProductDescription": "Remotely control this wall dimmer from anywhere. Features preset on-level, and on and off speed control.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f0f46cab5e7338216384.png",    "Price": 195,    "DistributorPhone": 35193768366.0,    "QuantityStock": 117  },  {    "Id": 38,    "ProductName": "Insteon Hidden Door Sensor (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f1a86cab5e7338216388.png",    "Category": "Detectors & Sensors",    "ProductDescription": "Know whether a door has been opened or closed. Can be installed inside the door or door frame.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f1a86cab5e7338216388.png",    "Price": 187,    "DistributorPhone": 35193768358.0,    "QuantityStock": 97  },  {    "Id": 41,    "ProductName": "Insteon LampLinc Dimmer Module (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605eeb06cab5e733821637c.png",    "Category": "Lighting",    "ProductDescription": "A full-featured plug-in lamp dimmer that features an adjustable ramp rate, preset dim level and local control.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605eeb06cab5e733821637c.png",    "Price": 190,    "DistributorPhone": 35193768361.0,    "QuantityStock": 60  },  {    "Id": 45,    "ProductName": "Insteon Micro On/Off Module (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f0c36cab5e7338216382.png",    "Category": "Dimmers, Switches & Outlets",    "ProductDescription": "This module wires in behind your existing switch, giving you all the remote control of an Insteon relay switch.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f0c36cab5e7338216382.png",    "Price": 194,    "DistributorPhone": 35193768365.0,    "QuantityStock": 75  },  {    "Id": 43,    "ProductName": "Insteon Motion Sensor (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f1eb6cab5e733821638a.png",    "Category": "Detectors & Sensors",    "ProductDescription": "Trigger any Insteon-compatible device or scene with this wireless PIR motion sensor.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f1eb6cab5e733821638a.png",    "Price": 192,    "DistributorPhone": 35193768363.0,    "QuantityStock": 114  },  {    "Id": 39,    "ProductName": "Insteon On/Off Module (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605eef76cab5e733821637d.png",    "Category": "Dimmers, Switches & Outlets",    "ProductDescription": "Control a non-dimming fluorescent light or appliance, turning it on and off remotely.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605eef76cab5e733821637d.png",    "Price": 188,    "DistributorPhone": 35193768359.0,    "QuantityStock": 26  },  {    "Id": 42,    "ProductName": "Insteon On/Off Outlet (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f0de6cab5e7338216383.png",    "Category": "Dimmers, Switches & Outlets",    "ProductDescription": "Control either the upper or lower outlet independently, from a wall switch or from your smartphone.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f0de6cab5e7338216383.png",    "Price": 191,    "DistributorPhone": 35193768362.0,    "QuantityStock": 38  },  {    "Id": 47,    "ProductName": "Insteon Open/Close Sensor (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f1cd6cab5e7338216389.png",    "Category": "Detectors & Sensors",    "ProductDescription": "Attaches to a door or window and detects when it is opened or closed.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f1cd6cab5e7338216389.png",    "Price": 196,    "DistributorPhone": 35193768367.0,    "QuantityStock": 92  },  {    "Id": 44,    "ProductName": "Insteon SwitchLinc Wall Switch (Hub 2245-222)",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605f10a6cab5e7338216385.png",    "Category": "Dimmers, Switches & Outlets",    "ProductDescription": "Remotely control up to 1800W of lighting and motors (on/off) from any Insteon controller.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605f10a6cab5e7338216385.png",    "Price": 193,    "DistributorPhone": 35193768364.0,    "QuantityStock": 77  },  {    "Id": 29,    "ProductName": "Jawbone UP 2",    "Picture": "https://www.muzzley.com/uploads/devices/main_56998d292b3fcd9e19877d9a.png",    "Category": "Health & Fitness",    "ProductDescription": "A fitness and sleep tracker that works as your personal trainer.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56998d292b3fcd9e19877d9a.png",    "Price": 178,    "DistributorPhone": 35193768349.0,    "QuantityStock": 59  },  {    "Id": 30,    "ProductName": "Jawbone UP 3",    "Picture": "https://www.muzzley.com/uploads/devices/main_56998b1d2b3fcd9e19877d99.png",    "Category": "Health & Fitness",    "ProductDescription": "Tracks your sleep, activities and heart health.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56998b1d2b3fcd9e19877d99.png",    "Price": 179,    "DistributorPhone": 35193768350.0,    "QuantityStock": 20  },  {    "Id": 31,    "ProductName": "Jawbone UP 4",    "Picture": "https://www.muzzley.com/uploads/devices/main_56998a522b3fcd9e19877d96.png",    "Category": "Health & Fitness",    "ProductDescription": "Tracks heart health monitoring that features both Resting and Passive Heart Rate. On board analysis of diet and sleep.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56998a522b3fcd9e19877d96.png",    "Price": 180,    "DistributorPhone": 35193768351.0,    "QuantityStock": 42  },  {    "Id": 28,    "ProductName": "Jawbone UP Move",    "Picture": "https://www.muzzley.com/uploads/devices/main_569989a42b3fcd9e19877d95.png",    "Category": "Health & Fitness",    "ProductDescription": "Tracks your activity and sleep, and works as a smart coach and food logging.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569989a42b3fcd9e19877d95.png",    "Price": 177,    "DistributorPhone": 35193768348.0,    "QuantityStock": 59  },  {    "Id": 24,    "ProductName": "Koubachi WiFi Plant Sensor",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001642a17e37ef66a0c5c4.png",    "Category": "Garden",    "ProductDescription": "Tells you when and how to care for your plants.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001642a17e37ef66a0c5c4.png",    "Price": 173,    "DistributorPhone": 35193768344.0,    "QuantityStock": 98  },  {    "Id": 1,    "ProductName": "LIFX",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001ea6215708f9755113ed.png",    "Category": "Lighting",    "ProductDescription": "The brightest, most efficient Wi-Fi LED light bulb.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001ea6215708f9755113ed.png",    "Price": 150,    "DistributorPhone": 35193768321.0,    "QuantityStock": 48  },  {    "Id": 22,    "ProductName": "Lockitron Bolt",    "Picture": "https://www.muzzley.com/uploads/devices/main_5605fe186cab5e733821638d.png",    "Category": "Locks & Garage Doors",    "ProductDescription": "Unlock your door without keys.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5605fe186cab5e733821638d.png",    "Price": 171,    "DistributorPhone": 35193768342.0,    "QuantityStock": 113  },  {    "Id": 63,    "ProductName": "MiLight",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001e4f215708f9755113eb.png",    "Category": "Lighting",    "ProductDescription": "An incredibly smart, energy efficient, multicolor LED lightbulb.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001e4f215708f9755113eb.png",    "Price": 212,    "DistributorPhone": 35193768383.0,    "QuantityStock": 34  },  {    "Id": 59,    "ProductName": "Misfit Flash",    "Picture": "https://www.muzzley.com/uploads/devices/main_569988de2b3fcd9e19877d94.png",    "Category": "Health & Fitness",    "ProductDescription": "A sleek, sporty fitness tracker that measures your activity and sleep and comes in a variety of colors.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569988de2b3fcd9e19877d94.png",    "Price": 208,    "DistributorPhone": 35193768379.0,    "QuantityStock": 125  },  {    "Id": 58,    "ProductName": "Misfit Shine",    "Picture": "https://www.muzzley.com/uploads/devices/main_5699884b2b3fcd9e19877d93.png",    "Category": "Health & Fitness",    "ProductDescription": "Monitors your sleep, steps, calories and distance.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5699884b2b3fcd9e19877d93.png",    "Price": 207,    "DistributorPhone": 35193768378.0,    "QuantityStock": 112  },  {    "Id": 3,    "ProductName": "Nest Learning Thermostat®",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001d0b215708f9755113e4.jpg",    "Category": "Thermostats",    "ProductDescription": "Set the perfect temperature and save money while you're away.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001d0b215708f9755113e4.png",    "Price": 152,    "DistributorPhone": 35193768323.0,    "QuantityStock": 77  },  {    "Id": 4,    "ProductName": "Nest Protect: Smoke + Carbon Monoxident",    "Picture": "https://www.muzzley.com/uploads/devices/main_56097e0b6cab5e733821638e.jpg",    "Category": "Detectors & Sensors",    "ProductDescription": "It speaks up to tell you if there's smoke or CO and tells you where the problem is so you know what to do.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56097e0b6cab5e733821638e.png",    "Price": 168,    "DistributorPhone": 35193768331.0,    "QuantityStock": 145  },  {    "Id": 17,    "ProductName": "Netatmo Rain Gauge",    "Picture": "https://www.muzzley.com/uploads/devices/main_5701bf8367e85eab8b8bc69c.png",    "Category": "Weather",    "ProductDescription": "It provides real-time readings of the amount of rainfall and accumulated precipitation data.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5701bf8367e85eab8b8bc69c.png",    "Price": 166,    "DistributorPhone": 35193768337.0,    "QuantityStock": 18  },  {    "Id": 19,    "ProductName": "Netatmo Thermostat",    "Picture": "https://www.muzzley.com/uploads/devices/main_5701c17467e85eab8b8bc69e.png",    "Category": "Thermostats",    "ProductDescription": "Save 37% on your energy consumption and reduce your carbon footprint with the Netatmo Thermostat.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5701c17467e85eab8b8bc69e.png",    "Price": 168,    "DistributorPhone": 35193768339.0,    "QuantityStock": 47  },  {    "Id": 8,    "ProductName": "Netatmo Weather Station",    "Picture": "https://www.muzzley.com/uploads/devices/main_56001ce1215708f9755113e3.png",    "Category": "Weather",    "ProductDescription": "Use indoor temperature, relative humidity and CO2 readings to live in a healthier home.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_56001ce1215708f9755113e3.png",    "Price": 172,    "DistributorPhone": 35193768328.0,    "QuantityStock": 140  },  {    "Id": 18,    "ProductName": "Netatmo Wind Gauge",    "Picture": "https://www.muzzley.com/uploads/devices/main_5701c05367e85eab8b8bc69d.png",    "Category": "Weather",    "ProductDescription": "It uses the latest in ultrasound technology to reliably and accurately measure the wind's speed and direction.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5701c05367e85eab8b8bc69d.png",    "Price": 167,    "DistributorPhone": 35193768338.0,    "QuantityStock": 99  },  {    "Id": 7,    "ProductName": "Philips Hue",    "Picture": "https://www.muzzley.com/uploads/devices/main_560017b167cd076e6aad369e.png",    "Category": "Lighting",    "ProductDescription": "Lets you control lights and change your environment.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_560017b167cd076e6aad369e.png",    "Price": 171,    "DistributorPhone": 35193768327.0,    "QuantityStock": 142  },  {    "Id": 20,    "ProductName": "Rachio Iro",    "Picture": "https://www.muzzley.com/uploads/devices/main_5600184567cd076e6aad36a0.png",    "Category": "Garden",    "ProductDescription": "A WiFi sprinkler controller that waters like it knows the future.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5600184567cd076e6aad36a0.png",    "Price": 169,    "DistributorPhone": 35193768340.0,    "QuantityStock": 138  },  {    "Id": 33,    "ProductName": "Withings Activité",    "Picture": "https://www.muzzley.com/uploads/devices/main_5699859c2b3fcd9e19877d91.png",    "Category": "Smart Watches",    "ProductDescription": "An elegant Swiss Made timepiece combining a high-end watch with an advanced activity tracker.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5699859c2b3fcd9e19877d91.png",    "Price": 182,    "DistributorPhone": 35193768353.0,    "QuantityStock": 22  },  {    "Id": 34,    "ProductName": "Withings Activité Pop",    "Picture": "https://www.muzzley.com/uploads/devices/main_569985fb2b3fcd9e19877d92.png",    "Category": "Smart Watches",    "ProductDescription": "A playful watch combining time & activity tracking.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569985fb2b3fcd9e19877d92.png",    "Price": 183,    "DistributorPhone": 35193768354.0,    "QuantityStock": 111  },  {    "Id": 36,    "ProductName": "Withings Aura",    "Picture": "https://www.muzzley.com/uploads/devices/main_5699853f2b3fcd9e19877d8f.png",    "Category": "Health & Fitness",    "ProductDescription": "A bedroom system to track and improve your sleep from dusk till dawn.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_5699853f2b3fcd9e19877d8f.png",    "Price": 185,    "DistributorPhone": 35193768356.0,    "QuantityStock": 92  },  {    "Id": 35,    "ProductName": "Withings Blood Pressure Monitor",    "Picture": "https://www.muzzley.com/uploads/devices/main_569984a02b3fcd9e19877d8d.png",    "Category": "Health & Fitness",    "ProductDescription": "Easy and precise self-measurement of your blood pressure with your smartphone.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569984a02b3fcd9e19877d8d.png",    "Price": 184,    "DistributorPhone": 35193768355.0,    "QuantityStock": 81  },  {    "Id": 37,    "ProductName": "Withings Body Analyzer",    "Picture": "https://www.muzzley.com/uploads/devices/main_569983212b3fcd9e19877d8b.png",    "Category": "Health & Fitness",    "ProductDescription": "Measures weight, body composition, heart rate and air quality.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569983212b3fcd9e19877d8b.png",    "Price": 186,    "DistributorPhone": 35193768357.0,    "QuantityStock": 118  },  {    "Id": 32,    "ProductName": "Withings Pulse OX",    "Picture": "https://www.muzzley.com/uploads/devices/main_569984272b3fcd9e19877d8c.png",    "Category": "Health & Fitness",    "ProductDescription": "A tracker to monitor your activity and sleep, read vital signs and improve your overall health.",    "DistributorLogo": "https://www.muzzley.com/uploads/deviceslogos/brand_569984272b3fcd9e19877d8c.png",    "Price": 181,    "DistributorPhone": 35193768352.0,    "QuantityStock": 34  }]


lolol

Sorry Tim.
Believe me, I didn't noticed that you were talking about "mobile".

In mobile you have an Action that is the CreateOrUpdateAll...
It accepts a list (contrary to the Web version).

The difference is that it can't do the mapping between the structure you are providing to the record, because your structure does not have the sames types (in the example from the training they have the same type)

However, sounds like I can get around the type-issue by looping through the records, temporarily  assigning variables, and updating the entity.

Do I even need an entity? My goal is to display the records in a form.  (I used the entity because the exercise did).
Could I iterate into a list directly?

I considered "JSONDeserialize" however it doesn't 'see' the REST response as valid input.

Hi Tim,

You can't deserialize because the response of the action will be a list, not a JSON.
Yes, one option is to iterate through the list and save one record at a time.

Another option is to change the JSON response BEFORE it is converted in the List, in the OnAfterResponse action of the consumed REST. This way, you can change the response (JSON file) to match the format you need, and give a record type that is the same as the one from entity (without the nested structures).

This way you can pass the list directly, without having to process each record.

Cheers,
Eduardo Jauch