Ryan Schmidt
unread,Jun 6, 2015, 8:25:35 AM6/6/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nod...@googlegroups.com
On Jun 5, 2015, at 9:40 PM, JBD wrote:
> I have JSON object called Lodge, the start of which is like this:
>
> [ { LodgeId: 12,
> HasInventory: true,
> Rooms:
> [ { Room: { Name: { invariant: 'Queen Test' }, Id: 100, Culture: null },
> LodgeId: 12,
> NightlyRates: null,
> NightlyRateErrors: null,
>
> .... etc
>
> As you can see, it's an array with no name. How do I display for example the LodgeId?
>
> I tried this but it doesn't work, displays nothing: {#Lodge}{#.}{LodgeId}{/.}{/Lodge}
>
> What am I doing wrong? Thanks.
I don't know dust syntax, but what you have there is an array, not an object. To refer to the LodgeId of the object in the first array element, in JavaScript, you would write:
Lodge[0].LodgeId