Using current() repeating table from data connection - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Using current() repeating table from data connection

Last post 03-30-2017 12:43 PM by Hilary Stoupa. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 03-22-2017 03:57 PM

    Using current() repeating table from data connection

    I am trying to extract data from a repeating table from a secondary data connection based on a filter from the main data source. Then concat that data in text box. My problem is around using current() (I think). When the field I am filtering by on the main data source is blank, the formula works (data populates from all the rows with blank data), but if the data matches the filter condition, only the data from the first row of the table populates in the text box.

    What I want is something like this:

    Text Box = 45;69;77 (pulls from the row that meets the filter condition)

    What I get is this:

    Text Box = 78 (pulls from the first row, not the correct row from the table)

    Here is my formula:

    dMath:Eval(xdMath:Eval(xdXDocument:GetDOM("Workbaskets_US_Assignments")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:US_x0023_ = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:ID], 'concat(xdXDocument:GetDOM("Workbaskets_US_Assignments")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:New_x0020_Assignment_2, ";")'), "..")

    Do I need to add current() somewhere?
  • 03-23-2017 07:35 AM In reply to

    Re: Using current() repeating table from data connection

     Try:

    dMath:Eval(xdMath:Eval(xdXDocument:GetDOM("Workbaskets_US_Assignments")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:US_x0023_ = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:ID], 'concat(d:New_x0020_Assignment_2, ";")'), "..") 
     

    Hilary Stoupa

  • 03-23-2017 08:15 AM In reply to

    Re: Using current() repeating table from data connection

    It is working now, thanks. But the semicolon is not placed between values, only at the end.

    It is showing this:

    36589;

    But it should be showing this:

    36;58;9
  • 03-23-2017 08:30 AM In reply to

    Re: Using current() repeating table from data connection

    Weird. Can you paste the full XPath of your formula back in a reply?
    Hilary Stoupa

  • 03-23-2017 08:38 AM In reply to

    Re: Using current() repeating table from data connection

    Sure, here is the Xpath:

    xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("Workbaskets_US_Assignments")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:US_x0023_ = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:ID], 'concat(d:New_x0020_Assignment_2, ";")'), "..")
  • 03-23-2017 05:21 PM In reply to

    Re: Using current() repeating table from data connection

     It looks right to me. I guess you could always try:

    xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("Workbaskets_US_Assignments")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:US_x0023_ = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:ID]/d:New_x0020_Assignment_2, 'concat(., ";")'), "..")  

    Hilary Stoupa

  • 03-24-2017 07:43 AM In reply to

    Re: Using current() repeating table from data connection

    I am still getting the same results. When I preview the form in Infopath, the text box is formatted correctly. When I publish to SharePoint, the formula only places the semicolon at the end. Both formulas you provided give the same results.

    InfoPath preview: 78;56;45

    SharePoint view: 785645;
  • 03-24-2017 07:50 AM In reply to

    Re: Using current() repeating table from data connection

    Oh. I see. I hadn't realized you were saying the form is behaving differently in the browser vs. in the filler. I've never seen that happen w/ a double eval before. When you say "SharePoint view" - you do mean in the form itself in the browser, right? You aren't talking about a promoted property value or anything like that? What version of SharePoint are you using? Is the value a default in a field, in a calculated value, or in a rule that sets a field? I'd like to see if I can reproduce the issue.
    Hilary Stoupa

  • 03-24-2017 09:21 AM In reply to

    Re: Using current() repeating table from data connection

    The form data source is a SharePoint list on SP2013. I created the list in SP first, then I created the Infopath form. The form is a browser form that opens when a user edits or creates a new a SP list item. I have tried using the Xpath in a calculated field and in a text box with a rule to set the value on form load. Either way I get the same incorrect formatting for the concat...semicolon only at the end.

    The SP list in the Eval function, has another SP lookup field. So there are really 3 SP lists:

    (1) Main Data (2) Secondary (Workbaskets_US_Assignments) (3) Secondary (Assignments)

    The numbers populating from the Xpath are the ID numbers from Assignments (3) SP list. I did see a warning when I ran the design checker in InfoPath, see attached image.
  • 03-30-2017 12:43 PM In reply to

    Re: Using current() repeating table from data connection

     Weird. I'm not sure I've ever tried double eval in a list form. I may have a chance to try it tomorrow - I'll let you know if I have the same result.

    Hilary Stoupa

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