Update another field using date selected in date picker field - InfoPath Dev
in

InfoPath Dev

Update another field using date selected in date picker field

Last post 09-25-2013 09:39 AM by iCandoall. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-24-2013 09:31 AM

    Update another field using date selected in date picker field

    Hi All.

    I am fairly new to using infopath. Basically I have a form is to be opened using web form sevices by users. My challenge is that in one of the fields I want users to select the date using a date picker on the infopath form which is the submitted to a Sharepoint 2007 list. When a User enters a date in datePickerField, a separate Week No field on the form should be updated with with a week value that corresponds to the date that has been entered. This date is compared to date values in a Share Point 2007 list which has corresponding week number values relevant to each date in order to retrieve the correct Week No from the Share Point list. In total there is 365 rows in the list made up of Date Form Is Completed column and Year_Week_Day column- (which is the  value is used to update Week No field in InfoPath form) 

    My challenge is that when datePickerField sets the Week No, it picks up the first Week Number value from Share Point list always, ignoring fact that should be value corresponding to date that has been selected. Ideally, a different Week No value should come up depending on the date that has been selected as shown in attachment

    I have set a rule on the  datePickerField  give me a week number value whose date form completed on the sharepoint list is equal to the date picker field - this does not update the week number.

    When I set the week number field with a rule which says get me the a week number value without a filter - the first week numnber value on the SharePoint list updates the Week No field on the InfoPath form

    I am sure this has to do with the way the way my rules for comparing the DateEnteredOnForm and the DateInSharePointList.

    I am using version 2007 of both SharePoint and InfoPath

     

     

  • 09-24-2013 06:15 PM In reply to

    Re: Update another field using date selected in date picker field

    I'm going to guess that in InfoPath, the actual XML value of your date is something like "2013-04-02" and the data from SharePoint is probably "2013-04-02 00:00:00" or some such. You can find out by placing a text box or calculated value bound to the different fields on the form and set the format to display the XML value. Once you know what the actual values are, you'll be able to adjust your condition accordingly.

    Hilary Stoupa

  • 09-25-2013 01:30 AM In reply to

    Re: Update another field using date selected in date picker field

    Hi Hilary

    Thanks for your prompt response. Yes I placed a text box (datePickerTest) in the form to test the date format that is outputted behind the scenes when a user selects a date and it shows as yyyy-mm-dd, although the date that is displayed in the Date Picker field shows the format dd/mm/yyyy, which is the format that I want in order to compared with the dates in my Share Point List. I am not sure whether this is what you mean by "You can find out by placing a text box or calculated value bound to the different fields on the form and set the format to display the XML value". I then used the concat and substring functions to change the format of the date in the text box - datePickerTest to display dd/mm/yyyy on the form and used the formatted date for a compariso with the date on the secondary connection with  fields from the Share Point List. Now what I dont know is whether the date I have formatted using the concat and substring functions above is only visual presentation on the infopath form field only or formatted simillarly in XML.  

    When I set the Week No field using the test field with the the week no value from the secondary data connection, the field is set to the first instance of the week no values in the secondary data connection.

    I have a PDF of Share Point list with columns, and rules I have applied not sure how to attach it here. Once again thank you very much for you help.

  • 09-25-2013 09:39 AM In reply to

    Re: Update another field using date selected in date picker field

    Hi Hilary

    Just to let you know that I have now resolved the above issue. The field was using the first instance of the week number from the data sharepoint list because I had not declare all the parameters in the list. Once i filtered the rule to inclued addDays(DateOnSharepointList, number of instances of week no) - in my case it was 365 - numbe of dates. Hope this will help someone. Once again thank you very much for you advice above, helped a lot to troubleshoot the problem once I knew the date formats in sharepoin list and infopath field

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.