I have created a calculated field using the following XPath statement that will create a semi-colon seperated list based on selected values in a multiple selection list box. The data that is stored in the multiple selection list box are IDs, so I perform a lookup in a seperate data feed to pull in human readable titles.
It works perfectly in InfoPath preview mode, but fails to function when published to SharePoint 2010 (gets an empty list, no errors).
After further investigation I have narrowed the issue down to the current() function within the statement. If I replace current() with a value of 1 I get a repeating list of a single title.
Is there another why to reference the current value within the nested eval statements without using current()?
xdMath:Eval(xdMath:Eval(dfs:dataFields/my:SharePointListItem_RW/my:Related_x0020_To/Value, 'concat(substring(xdXDocument:GetDOM("Technology Platform Temp")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[../d:ID = current()], 1, (count(../Value) = 2 or ../Value[last()] = current()) * string-length(xdXDocument:GetDOM("Technology Platform Temp")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[../d:ID = current()])), substring(concat(xdXDocument:GetDOM("Technology Platform Temp")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[../d:ID = current()], "; "), 1, ((count(../Value) > 2 and ../Value[last()] != current()) * (string-length(current()) > 0)) * string-length(concat(xdXDocument:GetDOM("Technology Platform Temp")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[../d:ID = current()], "; "))))'), "..")
Any help would be much appreciated!