Help converting Forms Date to Calendar Date-Time

Help converting Forms Date to Calendar Date-Time

I need help writing a custom Flow function to convert from the date format of a Form date field:

yyyy-mm-dd

to the date-time format of a Calendar entry:

yyyy-MM-ddTHH:mm:ssZ

The Calendar item will be an All-Day event.

It is acceptable for the Time to be hard-coded to 00:06:00

Please help with how to format the input into the Flow formatDate() function.
 
The input to Calendar is:




The error message from Calendar is:



My function is this:
  1. string formatDate(string dateStr, string fromFormat, string toFormat)
  2. {
  3. fromFormat = "yyyy-MM-dd";
  4. toFormat = " yyyy-MM-ddTHH:mm:ssZ";
  5. dateObj = dateStr.toTime(fromFormat);
  6. info dateObj;
  7. return dateObj.toString(toFormat);
  8. }
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方