Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

Creating a date field from strings

$
0
0

Hey there,

I'm not sure if this is the right place to post this, it seems the right forum, but apologies if it's not.

I work at a school and we've recently moved to Office 365 from MOSS 2007 and it seemed a good time to try rework the SharePoint booking calendar we have for ICT equipment. I've created a multi choice field to allow staff to tick what lessons they want to book, and I've got a date chooser to choose the day. When they click save a workflow runs that looks at what boxes are ticked to create strings of the start and end times and it copies the date into 2 string variables for the start and end date. This all works fine, I have the workflow update these variables into fields and that's working fine.

The problem occurs when I try and merge these 2 strings into a date/time field. Much googling around didn't find me anything for quite a while beyond 'use a workflow', but eventually I stumbled on a website that suggested setting a string variable using the following code: [%Variable: strStart_Date%]T[%Variable: strStart_Time%]:00Z (they are my variable names I've filled in) and then updating a date/time field with this string.

I thought this was working, but maybe I got lucky or something, as now when I create an item the workflow runs, but then gets suspended with "RequestorId: da25b094-6634-0668-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.FormatException: String was not recognized as a valid DateTime.   at System.DateTime.Parse(String s, IFormatProvider provider)   at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Exception from activity ParseDate DynamicActivity<DateTime> Cast<DateTime,Object> BuildDictionary<String,Object> Stage 1 Sequence Flowchart Start Time creator.WorkflowXaml_f84cde50_bde4_4b23_a746_17a21f4efdc2"

Can anyone offer any advice as to how I can get the separate date and time fields merged into one? I freely admit I'm not an experienced sharepoint guy - I've never had any proper training and get by by prodding, bodging and asking on forums like this :-) , but surely it must be possible?

Thanks :-)


Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>