Calculated value control not fetching and throwing corresponding values from SharePoint list - InfoPath Dev
in

InfoPath Dev

Calculated value control not fetching and throwing corresponding values from SharePoint list

Last post 06-20-2013 09:02 AM by jseeker. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-19-2013 08:58 AM

    Calculated value control not fetching and throwing corresponding values from SharePoint list

    Hi,

    I am new to InfoPath but have good knowledge on SharePoint. I am creating an InfoPath form in the InfoPath 2007 Form filler format using InfoPath 2010 Designer (because backend systems are InfoPath 2007).

    I have a list hosted in SharePoint that has 5 columns with one of the column being unique – employee ID. This employee ID (is a whole number) is being requested to be typed in InfoPath form. Once the users type the employee ID and hit enter, the remaining 4 columns (Title, Department, Manager, Pay-grade) need to be populated in the InfoPath form.

    I use calculated value control (because that is the requirement from my team lead) in InfoPath and am trying to pull the corresponding values (Title, Department, Manager, Pay-grade) for the employee ID that is typed in the form.

    My calculated value control in InfoPath always returns the value from the first row corresponding cell value irrespective of the employee id being provided. When I try fetching the lookup value, I am not able to write the correct code for XPath calculated value (to pick the correct row and corresponding cell). Any help is appreciated.

    Thanks in advance. 

  • 06-19-2013 12:07 PM In reply to

    Re: Calculated value control not fetching and throwing corresponding values from SharePoint list

    The problem with this scenario is the lack of filtering. The calculated value is a single field but it's hooked up to repeating data, so it just grabs the first row.

    I'm thinking that in the process of setting up the Calculated Value you might see a "Filter Data" button. This is what you're missing. You'll be matching the ID that has been entered to the ID in the secondary data source.

    Hope this helps!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-19-2013 12:26 PM In reply to

    Re: Calculated value control not fetching and throwing corresponding values from SharePoint list

    Thanks ErnestoM for your reply and exactly stating that I need the right filter criteria. My XPath "path value" for the calculated value control to fetch "Job Title" for a given "Employee ID" is this:

    xdXDocument:GetDOM("Employee_Tracker")/dfs:myFields/dfs:dataFields/dfs:Employee_Tracker/@Job_Title

    In this case, I am trying to pull the Job_Title for "Employee ID" being typed in the form. As you mentioned, I need some way of weaving the Employee_ID filter into the XPath command above..

    Thanks for your time and advise.

  • 06-19-2013 12:31 PM In reply to

    Re: Calculated value control not fetching and throwing corresponding values from SharePoint list

     So, when setting up the Calculated Value did you find the "Filter Data" button?

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-19-2013 01:07 PM In reply to

    Re: Calculated value control not fetching and throwing corresponding values from SharePoint list

    Thanks for the reply.

    This is what I have done in the calculated value properties.

    Calculated value --> Properties --> Data Source --> click function --> Insert formula window --> Insert field or group --> Filter Data -->Add --> Employee ID (from DB) = Employee ID (Field). When I hit OK and try to save it gives the following error message

    "A filter cannot be applied to the currently selected field. Select a different field"

    Alternately, I thought I can add a filter via rules (by setting a field value action) but when I click new rule, only formatting is enabled. Action and Formatting rules are greyed out.

    Thanks, please let me know if additional information is required.

     Thanks 

  • 06-20-2013 06:06 AM In reply to

    Re: Calculated value control not fetching and throwing corresponding values from SharePoint list

     What field did you select before clicking Filter Data? After Insert field or group, which field was selected for the filter you are adding?

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-20-2013 09:02 AM In reply to

    Re: Calculated value control not fetching and throwing corresponding values from SharePoint list

    Wow, thanks. I was about to respond to your question and I did the action step by step, document and voila, it worked....

    Thanks a lot ErnestoM for patiently pointing me in the right direction. Now, I have to do the same thing for other fields as well.... :-)

    Thanks once again.

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