Date / Time Formatting for Analytics

Date / Time Formatting for Analytics

TL;DR - I can't figure out how to format date time info without losing the time portion.



I am attempting to use Flow to Create a Row in Analytics every time a row is created in a Google Sheet.

The trigger works fine.

The action of Creating a Row is a little touchy because of the yellow highlighted date field formatting requirement:


Even though that looks like the format of the system Current Datetime field, the system field does not work with the Flow because of formatting issues.

To rectify this, I am attempting to use a custom function to format the date. My code looks like this:
  1. string formatDate(date myDate, string format)
  2. {
  3. dateStr = myDate.toString(format);
  4. return dateStr;
  5. }

I then insert the custom function into Flow, and populate the variables as shown below:

Unfortunately, this ends up stripping out the time portion of the datetime parameter, as shown below:



It seems like the function isn't recognizing the datetime as a datetime, only a date. Is that a declaration error in the custom function, or is something else going on?

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now