various shenanigans.

Submitting Date/Time with InfoPath to Web Services

I created an Infopath for users to request teleconference numbers.
I have two lists; Schedule and Conference List.

Schedule list had these columns: Title, Start Date, End Date, Attendees, Status, Assigned.
Conference List had these columns; Source (which will be set to Title above), Title, Phone Number, Start Date, End Date

Users get a standard request form which pulls and updates from the Schedule list.
ConReq

Admin/Operators receive workflow email that a request was placed and get an expanded form.

ConOpView

The magic is on the Assign button on the Operator section.
Rules are set to submit 5 values to the Conference List using a Web Service.

There are many good blogs that detail this process.
Reference with Screenshots: http://jaliyaudagedara.blogspot.com/2011/03/submitting-data-to-sharepoint-2010-list.html

The first step is to create an “Add List Items.xml.” This is the data to be inserted into the Conference List:



    
        
        
        
        
        
    

The easy part is submitting text fields. Date/Time fields will fail due to invalid type errors. A common problem I’ve seen reported is that you won’t get an error on submit and no data will be posted to your list.

This the workaround for Date/Time.
Create a textbox on your form; you can hide this later.
Set the value to your original form’s time value with the following formula.

concat(YourTimeField,"Z")

TimeField

This is the important piece. The UpdateListItems call needs that “Z” appended to the Time portion.
Your modified time output will look like YYYY-MM-DDTHH:MM:00Z.

When creating your Submit to Web Service rule; add the Submit portion first. In my example the rule is “AssignNumber”.
Go to Publish and Export Source Files. You will need to edit the manifest.xsf. Find your submit rule by name and paste the following BEFORE the submitAction.






This allows you to set your Add Item CAML to push the correct values to the Web Service Submit.

From InfoPath Designer; open the manifest.xsf file. Your rules may look like this.

ConAsnRules

You can edit the value of these rules as necessary. Note that I point my Start and End Date columns to the concat fields I created earlier.

Close Bitnami banner
Bitnami