Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Infopath 2010 - get values from repeating table

Posted on 2012-09-12
14
Medium Priority
?
2,556 Views
Last Modified: 2012-09-21
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!
0
Comment
Question by:mkarcher
  • 6
  • 6
13 Comments
 
LVL 28

Expert Comment

by:Clay Fox
ID: 38391878
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
 
LVL 6

Expert Comment

by:livanescu
ID: 38396586
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
 

Author Comment

by:mkarcher
ID: 38398169
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Expert Comment

by:livanescu
ID: 38400691
could you upload the xsn please?
0
 

Author Comment

by:mkarcher
ID: 38415767
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
 
LVL 6

Accepted Solution

by:
livanescu earned 2000 total points
ID: 38419075
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
 

Author Comment

by:mkarcher
ID: 38419849
Perfect! Thank you very much for your help!
0
 

Author Comment

by:mkarcher
ID: 38419988
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
 
LVL 6

Expert Comment

by:livanescu
ID: 38419934
my pleasure...
0
 
LVL 6

Expert Comment

by:livanescu
ID: 38419989
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
 

Author Closing Comment

by:mkarcher
ID: 38423683
Thank you!
0
 

Author Comment

by:mkarcher
ID: 38423684
thank you for the correction!
0
 
LVL 6

Expert Comment

by:livanescu
ID: 38423748
thank you. appreciated
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question