Discussions

Expand all | Collapse all

Add date/time field witn API_AddField

  • 1.  Add date/time field witn API_AddField

    Posted 03-06-2020 08:46
    I'm tying to figure out how to add a date/time field in the table using api call API_AddField.
    There's no such type mentioned in the official API reference.

    ------------------------------
    Stepan Gurov
    ------------------------------


  • 2.  RE: Add date/time field witn API_AddField

    Posted 03-06-2020 11:29
    Add that field as a date field and then use API_SetFieldProperties with the display_time tag in there. I'm sure you will need more than just that but I will link you to the help documentation.

    "display_time: Specifies whether the field shows date only in Quick Base UI or both date and time. This option turns a date field into a date-time field."

    https://help.quickbase.com/api-guide/setfieldproperties.html


  • 3.  RE: Add date/time field witn API_AddField

    Posted 03-08-2020 13:54
    Well, since for date/time fields display_time tag works properly, for date type fields it doesn't automatically switch type to date/time when applying the tag via api.

    Any api calls that can explicitly switch field type to date/time?

    ------------------------------
    Stepan Gurov
    ------------------------------



  • 4.  RE: Add date/time field witn API_AddField

    Posted 03-08-2020 14:06
    In the meantime I've figured out that setting a field type to 'timestamp' at creation is also possible (though it's not mentioned in the API reference), so it basically solves my problem :)

    ------------------------------
    Stepan Gurov
    ------------------------------