Getting nth element from secondary data source - InfoPath Dev Sign in | Join | Help in Browser Forms InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Browser Forms » Getting nth element from secondary data source Getting nth element from secondary data source Last post 11-12-2008 07:38 AM by guptasourav. 4 replies. Page 1 of 1 (5 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 11-11-2008 02:01 PM guptasourav Joined on 09-10-2008 Posts 46 Getting nth element from secondary data source Reply Contact Hi,I have a secondary data source returning some unique IDs. I want to get nth value from this datasource and show it in a text box.Is this possible without writing code. Is there a way to get this by using Xpath. ThanksSourav Filed under: infopath 2007, web based form, web service, browser enabled forms 11-11-2008 09:20 PM In reply to Shiva Joined on 04-15-2005 India Posts 694 Re: Getting nth element from secondary data source Mark as Not AnswerMark as Answer... Reply Contact Hello, We can get the nth position of element from repeating node using XPath. As below, xdXDocument:GetDOM(“Secondary DOM Name")/my:RootNode/my:NodeName/my:RepeatingNodeName[<position of the node>] Shiva / http://www.ggktech.com 11-11-2008 09:27 PM In reply to santhoshp Joined on 09-06-2007 Posts 66 Re: Getting nth element from secondary data source Mark as Not AnswerMark as Answer... Reply Contact Hi, Use the following Xpath to get nth value. xdXDocument:GetDOM("SecondaryDataSource")/Vehicles/Year[n]/@value In this example Year is repeating group and value is the attribute. Santhoshhttp://www.ggktech.com 11-12-2008 01:49 AM In reply to swathip Joined on 10-30-2007 India Posts 487 Re: Getting nth element from secondary data source Mark as Not AnswerMark as Answer... Reply Contact Hi,If the form is a browser form, [n] does not work. Use the following xpath as default value for a text box to get the nth element in a browser form.xdXDocument:GetDOM(“Secondary DOM Name")/RootNode/NodeName/RepeatingNodeName[count(preceding-sibling::RepeatingNodeName) = (n-1)]/fieldNodeExample: xdXDocument:GetDOM("Emp")/Employees/Emp[count(preceding-sibling::Emp) = (n-1)]/EmpID Swathipwww.ggktech.com 11-12-2008 07:38 AM In reply to guptasourav Joined on 09-10-2008 Posts 46 Re: Getting nth element from secondary data source Mark as Not AnswerMark as Answer... Reply Contact Thanks a lot for your reply. It solved my prob. ThanksSourav Page 1 of 1 (5 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hi,
I have a secondary data source returning some unique IDs. I want to get nth value from this datasource and show it in a text box.
Is this possible without writing code. Is there a way to get this by using Xpath.
Hello,
We can get the nth position of element from repeating node using XPath. As below,
xdXDocument:GetDOM(“Secondary DOM Name")/my:RootNode/my:NodeName/my:RepeatingNodeName[<position of the node>]
Use the following Xpath to get nth value.
xdXDocument:GetDOM("SecondaryDataSource")/Vehicles/Year[n]/@value
In this example Year is repeating group and value is the attribute.
Thanks a lot for your reply. It solved my prob.