locked
HELP! eval function to output a repeating table data to a string doesn't work RRS feed

  • Question

  • Hi guys!

    I try to use the eval() function in Infopath in order to get repeating values as a string.  I am following following link:

    http://blogs.msdn.com/b/infopath/archive/2006/04/05/569338.aspx

    The function looks as following:

    eval(eval(brands; "concat(Value;"; ")"); "..")

    where brands is taken from this control group (in secondary source)

    and values are taken from:

    I get following error message and I cannot get rid of it:

    Expected value type: ,

    Actual value: name
    eval(eval(xdXDocument:GetDOM("Project follow up")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:brands, "concat(xdXDocument:GetDOM("-->Project <--follow up")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:brands/Value;", ")"), ",,")

    all help appreciated

    Monday, December 9, 2013 11:59 AM

Answers

  • I made it working. I have add one repeating control and add one more field inside the group to show the result. Here is pic of my fields structure:

    This is result screen:

    As you can there is one extra semicolon so use substring as mention in belwo thread:

    http://www.infopathdev.com/forums/p/7124/93123.aspx


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Thursday, December 12, 2013 8:29 AM
    Moderator

All replies

  • Hello,

    You have to use single quote instead of double after value. Try this:

    eval(eval(Brand, "concat(Value, ';')"), "..")
    
    OR
    
    eval(eval(Brand, 'concat(Value, ";")'), "..")
    Let us know your result


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Tuesday, December 10, 2013 11:45 AM
    Moderator
  • hi again!

    Got the formula to stop giving error by typing this:

    eval(eval(brands; 'concat(xdXDocument:GetDOM("Project follow up")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:brands/Value, ";")'); "..")

    but!!!

    If I have

    Value 1

    Value 2

    Value 3 etc

    this function gives me a loooong string that looks like this:

    Value 1; Value 1;Value 1;Value 1...

    ideas?

    ******

    it doesn't even give the correct value, but concatenates the first value I have in the check list, even if it not the chosen one

    Thursday, December 12, 2013 6:22 AM
  • I made it working. I have add one repeating control and add one more field inside the group to show the result. Here is pic of my fields structure:

    This is result screen:

    As you can there is one extra semicolon so use substring as mention in belwo thread:

    http://www.infopathdev.com/forums/p/7124/93123.aspx


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Thursday, December 12, 2013 8:29 AM
    Moderator