Link to home
Start Free TrialLog in
Avatar of mkarcher
mkarcher

asked on

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!
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

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
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
Avatar of mkarcher
mkarcher

ASKER

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!
could you upload the xsn please?
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
ASKER CERTIFIED SOLUTION
Avatar of livanescu
livanescu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect! Thank you very much for your help!
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.
my pleasure...
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...
Thank you!
thank you for the correction!
thank you. appreciated