One scenario:In input fetch current date output should be next +2days ex:-if input 16 may 2022 then ouput is 18 may 2022…if output comes on weekends(treat Saturday and Sunday as weekends) then output should be next working day like monday
You describe an interesting scenario, where your API call is manipulating the date of the calendar entry to always be on a workday two days out.
I am trying to solve a problem before that:
How can I enter a day/time into a google sheet cell and no matter what date/time format I choose to post in that cell, the API call is able to interpret that date/time in the correct way to create the calendar entry correctly including time zone and sommer/winter time adjustment?
Once that is solved we can tackle the next scenarios.
I think what you’re asking for is an extension to the connector to allow you to get the raw data back. I.e. you have a date column where everything is formatted as a date, but the text shows 21 February 2022 and 23/02/2022 in another column.
When you query these in wm.io integration the formatted dates are returned, which are really pretty much as you see them in the sheet, but actually they’re a date so have a number behind them which allows you to do date subtraction/addition, etc.
The google sheets API has:
How values should be represented in the output. The default render option is FORMATTED_VALUE
How dates, times, and durations should be represented in the output. This is ignored if valueRenderOption is FORMATTED_VALUE . The default dateTime render option is SERIAL_NUMBER .
But you cannot control these from within the connector call currently.
If you use the API and pick unformatted/serial number you’ll get the serial-number back not the formatted value - Is that a correct understanding of what you’re looking for? (I notice in your sheet, they’re not even formatted as a date).
The downside to this is google sheets uses an unusual date representation (like excel), which means you’d have to convert the serial number to something else for a downstream call.
Most APIs tend to handle dates in the ISO8601 format you’re looking at.
Well, as Sheets and Calendar are both Google properties, I thought one should be able to understand the date formatting of the other.
That wasn’t the case here. So I tinkered with the format in the cell of the Google sheet, until it worked for Google Calendar. It needed to be super precise: 2022-05-05T13:00:00.000Z down to twice “:” and then a dot “.”.
In the worksheet I want to display the date/time in whatever format I like to display it: 5/5/2022 13:00:00 or Thursday, May 5, 2022 at 1:00:00 PM the API call shouldn’t care and still post the calendar entry at the right time/date including time zones.
What do I need to change in my API call to allow for the above formatting flexibility in the worksheet?
It’s a bit of a painful part of the google sheet APIs ultimately.
From my testing, even formatted as a date, you can input in any format it recognizes, but the only way to retrieve the consistent value (From the API which our connector uses) is to use the serial_number format and unfortunately this connector doesn’t provide this as an option right now.
I have a potential alternative approach which should be within your power - why not create another column in the sheet and use a formula in this column to convert the date formatted value into an ISO date format string (2022-05-05T13:00:00.000Z). This should then give a consistent representation when you use the connector for that column, which you can then use downstream, but still allow the input data to be date formatted, and specified in any format Google Sheets accepts.
I’ve not tested this, but don’t see why it wouldn’t work.
Fyi the serial number thing has it’s origin back in lotus1-2-3 (for those of us who remember this )