Forum Discussion

jamescrump's avatar
jamescrump
Qrew Member
31 days ago

Change Webook date format in JSON POST

I've seen several posts on manipulating dates, but none that seem to specifically apply to Webhook JSON POST in the Message body.

By default,

{
    "date": [
        {
            "value": "[mydate] "
        }
    ],

exports as mm-dd-yyyy, but I need to format to yyyy-mm-dd

Is this possible to reformat in this dialogue?

Thanks, James



------------------------------
james crump
------------------------------

9 Replies

  • Are you querying or inserting data. The schema response for dates per the documentation is supposed to be yyyy-mm-dd but I'm not aware of a setting to be able to request or alter that in either case of inserting or querying.

    If you're querying the data - you could always just ignore the date field and convert it to text in whatever format you need an include that field as opposed to querying for the actual date field. 



    ------------------------------
    Chayce Duncan
    ------------------------------
    • jamescrump's avatar
      jamescrump
      Qrew Member

      Hi Chayce,

      All I'm doing is putting the date field in a Webhook that POST json data to an external system.

      It seems that by default, the date being POST is mm-dd-yyyy and I need yyyy-mm-dd

      Thanks, James



      ------------------------------
      james crump
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        Ah. You can change the app settings overall to display the dates a certain way but that would be global across the app and I can't guarantee that it will do much. Schematically the 'display' settings that apply in QB don't always carry when it comes to the raw format for things like webhooks or queries. I personally wouldn't try and fight it - I would suggest just making a formula-text field that has it in yyyy-mm-dd format and include that in your payload. 



        ------------------------------
        Chayce Duncan
        ------------------------------
      • JeffPeterson1's avatar
        JeffPeterson1
        Qrew Captain

        They're going to retire webhooks as they currently exist,  so building it as a pipeline is the way to go anyway.



        ------------------------------
        Jeff Peterson
        ------------------------------