"invalid date/time" with SubmitToSharePointList - InfoPath Dev
in

InfoPath Dev

"invalid date/time" with SubmitToSharePointList

Last post 04-17-2012 07:27 PM by Jo-Anne Alfafara. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-16-2012 06:36 PM

    • teylyn
    • Top 500 Contributor
    • Joined on 03-29-2012
    • Taranaki, New Zealand
    • Posts 49

    "invalid date/time" with SubmitToSharePointList

    Hello,

    InfoPath 2010, SP 2010, qRules trial downloaded last week, so should be 4.1

    I have a form with two date/time fields and a few text fields. As long as I only fill in the text fields, the data will submit into SharePoint fine. When I have values in the date/time fields, though, I get an error:

    Errors occurred submitting to list: Invalid date/time value. <p> A date/time field contains invalid data. Please check the value and try again.

    The Success box proudly diplays a tick mark, but no data is added to the SharePoint list.

    The regional settings for both my local PC and the server OS, as well as the SP server are New Zealand and the date format is dd/mm/yyyy with 12hr time. I've tried dates like 10/10/2012, where order of dd and mm don't matter, but no success.

    Ideas welcome.

    cheers, Ingeborg

    teylyn - MS MVP (Excel) www.teylyn.com @ingeborgNZ
    Filed under: ,
  • 04-17-2012 02:01 AM In reply to

    Re: "invalid date/time" with SubmitToSharePointList

    Hi Ingeborg,

    Sorry to hear that you're having trouble. I haven't encountered this issue before. What happens when you change the column's data type to "Single line of text" instead of "Date and Time"?

    Jo-Anne

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 04-17-2012 04:01 AM In reply to

    • teylyn
    • Top 500 Contributor
    • Joined on 03-29-2012
    • Taranaki, New Zealand
    • Posts 49

    Re: "invalid date/time" with SubmitToSharePointList

    Hi Jo-Anne,

    Thanks for your reply. The SharePoint column needs to be a date/time column, since other things (views, DVWPs, calculations, etc.) depend on the values in that column. Also, I can't just change the data type in the existing list. If I want to retain the column name, I would need to delete the column and create it again as a text field, which would mean I'd lose all data previously submitted to it. Not an option. I could create a new text column. But then what? That would not give me the date/time value I need, or would it? I'm still very new at this, so I may be missing something. The list is used to collect information about time-critical events. I have two years worth of data with the date/time column in SharePoint. I now only want to introduce a new way to submit data to the list from other sites in the site collection. The InfoPath form seems to be the ticket, but why does it throw a wobbly for dates?.

    Is it not possible to submit a date/time value with SubmitToSharePointList? Or do I need to manipulate the value before submitting the list item? When I display the field value in a text box on the form, it shows as yyyy-mm-ddT00:00:00, so it is a date/time value.

    Can you re-create the issue?

    cheers, Ingeborg

    teylyn - MS MVP (Excel) www.teylyn.com @ingeborgNZ
  • 04-17-2012 06:22 AM In reply to

    Re: "invalid date/time" with SubmitToSharePointList

    Hello again,

    I tried it and was able to repro the error when the field that I'm mapping contains yyyy-mm-ddT00:00:00. It seems like SharePoint is a little sensitive with this kind of format, thus qRules is throwing an error.

    However, when I tried to "chop" the date/time using substring formulas, and concat them, I was able to submit to my list. This link might give you some ideas.

    Jo-Anne

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 04-17-2012 06:20 PM In reply to

    • teylyn
    • Top 500 Contributor
    • Joined on 03-29-2012
    • Taranaki, New Zealand
    • Posts 49

    Re: "invalid date/time" with SubmitToSharePointList

    I'm happy to give that a try. I've seen the Date template before and I'm familiar with the substring-before and -after functions. What I don't quite get is what you actually did: Convert the date into a string, the time into a string, concatenate and submit that result? Anything between date and time? A blank? A "T"?

    [Edit:] Whooopee, it's working.

    submit a calculated field with the formula: concat(substring-before(StartDate, "T"), " ", substring-after(StartDate, "T"))

    Thanks for the hint!

    teylyn - MS MVP (Excel) www.teylyn.com @ingeborgNZ
  • 04-17-2012 07:27 PM In reply to

    Re: "invalid date/time" with SubmitToSharePointList

    I'm glad you got it working! =)

    - Jo-Anne -

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.