Liz wrote:
I’m having trouble figuring out how to grab the value of the 1st field in a repeating table.
My table looks like this:Polo color Polo Type Polo Size Polo Price
I have a repeating table so the user can pick multiple polos. I want to be able to pull the polo color on each row to manipulate the data for the following columns. Right now I keep pulling the value in the 1st row, 1st field. It will not pick up the value of the new row, 1st field. Any ideas?
Hi Liz,
There is a function in InfoPath 2003 and InfoPath 2007 called current(), which you can use to reference the currently active row and then retrieve values within that row. I don’t know how you’ve set up your form template, so I’m going to give you some general instructions on how you can test and see how the current() function works. Try the following:
- Add a repeating table to your form template. One with 3 columns will do just fine.
- Double-click the field in the third column and then click on the formula button behind the Default Value field.
- On the Insert Formula dialog box, type
current()/../my:field1 - Click OK on all open dialog boxes.
Test the form by typing in something in the field in the first column. The value you typed in should appear in the third field in the same row once you leave the first field. Add another row and do the same. See how the current() function works?
You can also do this programmatically in InfoPath 2003. I once wrote the following article about this: Programmatically retrieve the value of another field in the same row of a repeating table.
Good luck with implementing current() in your own solutions!

Comments to this post were closed 30 days after it was published.