Infopath 2010 - get values from repeating table

Hello,

I have a repeating table and I would like to copy the content of the 3 last rows into another static table. (The values from the static table will be later imported by another programm).

My problem is that I do not know how I can access to the last row, the last row-1 and the last row-2.

The repeating table has an hidden counter column which counts the rows. I was thinking taking the biggest number in the column (max(counter)) and look for the row where the counter column is set to (max(counter)-1) and (max(counter)-2). Again I do not know how to access to these rows.

Do you have an idea?

Thank you in advance for your help!
mkarcherAsked:
Who is Participating?
 
livanescuCommented:
this is what i could come up with...
each target field will be reevaluated when the source gets updated.
the xsn file is actually a zip (check it out yourself...you'll find all components); rename this one to xsn and it should work...
v2-setFromCalculations.zip
0
 
Clay FoxDirector of Business IntegrationCommented:
You would want to use a filter, so set field to your static and then the source would be your repeating structure where key = max(key) or max(key) -1 etc.

But research filters, that is the secret sausce you are looking for.

You can find more at www.infopathdev.com
0
 
livanescuCommented:
Behind the beautiful display infopath is providing, the content is a simple text file in XML format.
to access parts of the xml you need XPath - here is a very useful tutorial: http://zvon.org/comp/r/ref-XPath_2.html
hth
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
mkarcherAuthor Commented:
Thank you for your answers! As you certainly remarked I am a newbee in the xml programming. I tried several basic functions in the formula field from InfoPath like current(), position() or last(), which doesn't function.

I had a look to XPath but I do not know how to integrate it into my InfoPath formular. Could you please give me a concrete example or tutorial?

Thanks in advance!
0
 
livanescuCommented:
could you upload the xsn please?
0
 
mkarcherAuthor Commented:
Sorry I am on a business trip with restricted access to my mails.
Attached you will find the file .xsn (renamed in .txt because of the upload).

Summarry: I want to copy the 3 last rows from the repeating table into the fixed table (just below the repeating table).

Thanks for your help!
test3.zip
0
 
mkarcherAuthor Commented:
Perfect! Thank you very much for your help!
0
 
mkarcherAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for mkarcher's comment #a38419849

for the following reason:

The answer was very quick and well explained.
0
 
livanescuCommented:
my pleasure...
0
 
livanescuCommented:
I was thinking that, as I provided the correct response, to get a credit for it - might be beneficial for others looking for a similar solution...
I am not really interested in points, but they would count as well sometimes...
0
 
mkarcherAuthor Commented:
Thank you!
0
 
mkarcherAuthor Commented:
thank you for the correction!
0
 
livanescuCommented:
thank you. appreciated
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.