ID for MetaData

37 views
Skip to first unread message

UtahLeg -Sara

unread,
May 24, 2012, 1:05:20 PM5/24/12
to granicus-...@googlegroups.com
Does anyone have a quick way to get the ID back from the KeyMapping object that is returned when I add MetaData to an event using AddEventMetaData?  I haven't played with this yet, so I might be asking a dumb question.

Javier Muniz

unread,
May 24, 2012, 1:14:30 PM5/24/12
to <granicus-developers@googlegroups.com>, granicus-...@googlegroups.com
Hi Sara,

The key mapping is essentially a hash that allows you to lookup an ID based on your own IDs. So, if you're sending in more than one metadata object, you should assign a foreignid to them, then you can iterate over the key mapping looking for the item that matches the ID you put in.

It's a little weird, but it was the only way I could figure out to allow bulk uploads of data and still allow you to have ID associations on auto incremented numerical keys.

Another strategy you can use is to assign guids to the items before passing them in. If a guid is assigned then the system will use that instead of generating a new one and you can just store the value.

Javier Muniz

unread,
May 24, 2012, 1:24:57 PM5/24/12
to <granicus-developers@googlegroups.com>, granicus-...@googlegroups.com
Almost forgot. If you're just sending one metadata object at a time then the key mapping will only have a single entry so you can do:

Keymap[0].GranicusID

On May 24, 2012, at 10:05 AM, "UtahLeg -Sara" <humm...@gmail.com> wrote:

UtahLeg -Sara

unread,
May 24, 2012, 1:29:27 PM5/24/12
to granicus-...@googlegroups.com
lol, I was just about to ask that question.  Perfect.  Thanks!!
Reply all
Reply to author
Forward
0 new messages