none
InfoPath: Adding a calculated field in repeating table

    Question

  • I have an IP form with 2 SharePoint (un-related) lists.  List A has been added to the form as a repeating table.  What I'm trying to do is create a calculated column in the repeating table that will lookup the ReviewDate in List B if a matching Email is found.

    I'm setting the default value of the calculated field using the XPath query below, but this only returns the first matching record found from List B, and sets the value for all rows in the repeating table to this value.

    xdXDocument:GetDOM("List B")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ReviewDate[../d:ReviewerEmail = xdXDocument:GetDOM("List A")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:UserEmail]

    I'm attempting to modify this query to use the current() function (below) so that the query is only using the current row Email address, but I'm getting the error "does not point to a valid location path of a field or group".

    xdXDocument:GetDOM("FPR Feedback")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Review_x0020_Date[../d:Reviewer_x0020_Email = current()/d:Feedback_x0020_Provider_x0020_1_]

    I'm assuming that I should be able to do this with a repeating table.  

    Thursday, May 10, 2012 9:48 PM

All replies

  • Hi ,

    I understand that you have a List A with fields UserEmail and List B with fields ReviewDate ,ReviewEmail .You want to add a calculated value to get the ReviewDate in List B whose UserEmail is equal to ReviewEmail in List A .You can set the calculated value to get the ReviewEmail in the repeating table .I have a test based on your description and use the formula can do this kind of thing . You should check your second XPath expression .

    When add the XPath expression ,you can choose to Insert Field or Group instead of typing XPath .Insert the ReviewDate form List B data connection .Click Filter Data to add a filer on the data returned .Set the condition as UserEmail(List A) is equal to ReviewEmail (List B ) .The formula will look like this ReviewDate[current()/UserEmail=ReviewEamil] .

    Thanks

    Entan Ming

    TechNet Community Support

    Friday, May 11, 2012 10:31 AM
    Moderator
  • I have tried using formula, but can't seem to get the current() function to properly validate.
    Friday, May 11, 2012 1:04 PM