View repeated fields value in textbox - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

View repeated fields value in textbox

Last post 01-29-2016 03:05 PM by Kaoru Okumura. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 01-27-2016 09:45 PM

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    View repeated fields value in textbox

    Is it possible to view repeated fields values in a textbox in the same document? I was able to get the first value shown and when ever I repeat the table and add a new value the old value in the textbox would be replaced with the newer one... Any clues please ? Thank you
  • 01-27-2016 10:08 PM In reply to

    Re: View repeated fields value in textbox

    Assuming you have InfoPath form library, and may add another field to show all repeated fields, I'd use concatenation function to show repeated fields.

    Sample form is attached,

    Let's say  xpath of the target field: /my:myFields/my:items/my:item/my:text, and  /my:myFields/my:items/my:item is repeating group.

    Please see the default value of Concatenated_text, which is

         eval(eval(item, 'concat(my:text, ", ")'), "..") 

    This generates the comma separated concatenation of fields my:text under repeating group item , and automatically save it to Concatenated_text.


     

  • 01-28-2016 04:44 PM In reply to

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    Re: View repeated fields value in textbox

    Thank you for helping out. I'm trying to make it work with my form but it isn't working.. What does "my" stand for ? I'm replacing item with my repeating group, and text with the field I want to repeat, I'm receiving an error ("ItemsOfInterestSub" does not point to a valid location path of a field or group.). Even though I have typed the group name correctly ... My form structure ShiftTurn -ItemsOfInterestGroup --ItemsOfInterestSub (Repeated Table) ---TicketNumber (Field I want to take its value in each repeat) -Summary (The textbox where I want to print TicketNumbers) How can I make your function work in that case ? Thank you in advance
  • 01-28-2016 04:52 PM In reply to

    Re: View repeated fields value in textbox

    I understand it's tricky and setting the parameters for eval is a bit difficult first. You can upload your InfoPath file using "Option" tab. Then we can take a look at it.... tnx
  • 01-28-2016 04:59 PM In reply to

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    Re: View repeated fields value in textbox

    I have uploaded the file, kindly check.. I would like to have Ticket# and other fields to be copied to the Executive Summary textbox Thank you
  • 01-28-2016 05:27 PM In reply to

    Attached the modified form that shows concatenated string ExecSum. Default value is set as:

    xdMath:Eval(xdMath:Eval(../my:ItemsOfInterestGroup/my:ItemsOfInterestSub, 'concat(my:IoI-TicketNum, " ", my:IoI-EventTitle, " ", my:IoI-Priority, " ", my:IoI-Status, " ", my:IoI-Remarks, "; ")'), "..")

    and you may modify concat part to make string you like.

        'concat(my:IoI-TicketNum, " ", my:IoI-EventTitle, " ", my:IoI-Priority, " ", my:IoI-Status, " ", my:IoI-Remarks, "; ")

     

     I would be safer to set the fields which contains concatenated string (currently ExecSum) as text, rather than rich text. and also you may want show this to uses as Calculated Value instead of text box. in case of text box, user may enter/modify it, which causes inconsistency between the repeating table. tnx 

  • 01-28-2016 05:55 PM In reply to

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    Re: View repeated fields value in textbox

    Thank you so much, really appreciate your help. What if I wanted to have an additional field that is from a different group ? Would that be achievable using same method ?
  • 01-28-2016 09:11 PM In reply to

    Re: View repeated fields value in textbox

    "additional field  that is from a different group" -- if you'd like to add it from repeating group, first, create similar eval(eval()) for the repeating group. and then concatenate these 2 together. Once you know how to handle repeating table, then you can apply it.

    for example, the following expression gives concatenated items of interest, and plus concatenated AnalystName Present.

    concat(xdMath:Eval(xdMath:Eval(../my:ItemsOfInterestGroup/my:ItemsOfInterestSub, 'concat(my:IoI-TicketNum, " ", my:IoI-EventTitle, " ", my:IoI-Priority, " ", my:IoI-Status, " ", my:IoI-Remarks, "; ")'), ".."), " /", xdMath:Eval(xdMath:Eval(../my:AnalystsOnShift/my:AnalystsOnShift-Sub, 'concat(my:AnalystName-Present, ", " )'), "..")) 

      

  • 01-29-2016 08:47 AM In reply to

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    Re: View repeated fields value in textbox

    Got it .. Thank you so much for your help :) Same goes with non repeatable fields ?
  • 01-29-2016 02:31 PM In reply to

    Re: View repeated fields value in textbox

    Same to non-repeating fields ;-) you can combine them using concat()
  • 01-29-2016 02:34 PM In reply to

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    Re: View repeated fields value in textbox

    Thank you was able to do it thanks to your help
  • 01-29-2016 02:45 PM In reply to

    • waelt
    • Not Ranked
    • Joined on 01-26-2016
    • Posts 13

    Re: View repeated fields value in textbox

    I'm trying to add new line between specific fields using this inside concat but it is not working xdXDocument:GetDOM("characters")/lookups/characters/@crlf
  • 01-29-2016 03:05 PM In reply to

    Re: View repeated fields value in textbox

    well, if you need new line, at least we need Rich Text field. Rich Text field is tricky, so I switched RichText into just text. you can try it back, and see if new line works.
Page 1 of 1 (13 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.