finding the update_id of calendar events

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

if i export a calendar report as csv or xml - each event has a 'update_id'.

it's the magic number that hooks the event to ical/caldav in the outside world.


anyway to get to it in native QB, without an export / parse/ re-import workflow?

Photo of Paul

Paul

  • 52 Points

Posted 4 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,184 Points 20k badge 2x thumb
It is poorly documented but the update_id is not a field associated with the record but rather a millisecond value used to resolve editing conflicts. The QuickBase API documentation has this  rather vague description:

update_id

Used to detect update conflicts when invoking API_EditRecord.

You could save this update ID when you add a new record, but it would be better to instead get the most recent update_id value later when you query for the record to get it and update it.

That said, the update_id returned by the API methods appears to have the same value as the [Date Modified] field if the save saw successful:
<record>   <t>2</t>   <date_created>1443022301008</date_created>   <date_modified>1443022393695</date_modified>   <record_id_>1</record_id_>   <record_owner>HaversineConsulting</record_owner>   <last_modified_by>HaversineConsulting</last_modified_by>   <update_id>1443022393695</update_id> </record>
I have always refrained from using update_id because I have never been certain how it is used by QuickBase in detail.  I would encourage you to visit this page and enter a comment asking for greater clarification by clicking on the "Comment on this page" link at bottom of the page:
http://www.quickbase.com/api-guide/index.html#edit_record.html?Highlight=update_id

The Staff Tech Writer Sybil is very good at fixing the API documentation if technical details are brought to her attention.
Photo of Paul

Paul

  • 52 Points
think we're talking about two different things.

easier way to see what I'm referring to:
make an ics field.
make an event, download the ics file, open it in a text editor.
EDIT THE SAME EVENT, download the ics file, open it in a text editor.


BEGIN:VCALENDAR
PRODID:-//Intuit//QuickBase//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
UID:bj6terpgnxs@quickbase.com   <----------------------- THIS ID
DTSTART;VALUE=DATE:20150924
DTEND;VALUE=DATE:20150925
TRANSP:OPAQUE
SEQUENCE:0
DTSTAMP:20150923T160400Z
SUMMARY:Big
LOCATION:Big
DESCRIPTION:CALENDAR
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER:-PT1080M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

the XML and CSV call it unique_id - it doesn't change when i edit the date record. it's the identifier for the Outside World Calendars - if i send, edit, and resend the ics to a user, their calendar will update the same event vs. making two separate events.

THAT unique Id.  can we get to THAT?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,184 Points 20k badge 2x thumb
You used "update_id" in the title of your question so that is what I thought you were asking about.

I didn't generate an ics field but the ics file yiou posted suggests that the UID value in the ics file may simply have a value of this formula:
Dbid()  & "@quickbase.com"
If that does not solve your problem there is another approach. Let's assume you have no control over the UID value QuickBase stamps into the ics file. In this case don't even use a ics field! It is possible with script to generate ANY file using field values and arrange for the file to be dynamically generated, downloaded and correctly named using a short amount of script and the download() method in this pastie:

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=355

Just use script to build a string of your ics file (ics_string) and call download like this:
download("myicsfile.ics", ics_string);
Photo of Paul

Paul

  • 52 Points
first - sorry about the bad title and wrong names. i've been looking at calendar/event problems for days and had my head full of everybody's different verbiage for the same things - should have double-checked before i posted. you did alot of typing to answer a question i asked incorrectly.

apologies.



i think i get what you're proposing, and it looks like it could solve a multitude of issues in one fell swoop. thanks.



it will take me a little time to get my head around the nuts and bolts implementation, though - my concepting is better than my coding is better than my troubleshooting.

i'll be back. :)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,184 Points 20k badge 2x thumb
No problem

> i think i get what you're proposing, and it looks like it could solve a multitude of issues in one fell swoop.

ics files are just text files and they support a lot more properties than what QuickBase uses. See:

https://en.wikipedia.org/wiki/ICalendar#Technical_specifications


And you can include multiple events in an iCalendar file:

http://stackoverflow.com/questions/1823647/grouping-multiple-events-in-a-single-ics-file-icalendar-s...


So the bottom line is that if you have the appropriate data in QuickBase in various fields and records you can use script and the API to generate the appropriate text file dynamically - you don't need to even use and ics field. And the same generality can be used for other common formats like vcard or even proprietary file formats.
Photo of Paul

Paul

  • 52 Points
So -I'm using the updated 'image onload technique', I've got a nice fun button configured to make the 'file download' happen.

what i'm NOT getting is how to make it download any given field as the text object, or how to get the code to make the text object out of a bunch of fields.

can you point me in the right direction?