Defaulting from a previous row

E

Erin

Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
S

S.Y.M. Wong-A-Ton

Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
 
E

Erin

Thanks - I tried a number of variations but was unable to get it to work.
I'm not an XPath expert, so I easily may be missing something obvious. This
is literally what I put in as the default value:

current()/../preceding-sibling::my:EmployeeExpense[1]/my:Description

I also tried variations but nothing worked. I also checked the "Only to the
data rows a user inserts".

S.Y.M. Wong-A-Ton said:
Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


Erin said:
Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
S

S.Y.M. Wong-A-Ton

Did you first click on the Formula button behind the Default Value field
before entering the expression? If not, try it that way. The "Insert Formula"
dialog box will open up. You must check "Edit XPath (advanced)" button at the
bottom of the dialog box and then paste in the expression.

If this does not work, look and see whether you've got the correct nodes and
paths to the nodes in the expression. Since I do not know what your main data
source looks like, I'm unable to give you more pointers at this time.
---
S.Y.M. Wong-A-Ton


Erin said:
Thanks - I tried a number of variations but was unable to get it to work.
I'm not an XPath expert, so I easily may be missing something obvious. This
is literally what I put in as the default value:

current()/../preceding-sibling::my:EmployeeExpense[1]/my:Description

I also tried variations but nothing worked. I also checked the "Only to the
data rows a user inserts".

S.Y.M. Wong-A-Ton said:
Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


Erin said:
Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
E

Erin

Yes, I used the Insert Formula dialog box to enter the formula (with "Edit
XPath (advanced)" checked). I'm at my wits end on this - I know it should be
very simple and appreciate any assistance you can give. One thing I didn't
mention previously is that my main data source is a SQL Server connection. I
don't know if that makes any difference.

I've also searched various other sites and posts and continue to try
variations, but nothing has worked.

Thanks,
Erin

S.Y.M. Wong-A-Ton said:
Did you first click on the Formula button behind the Default Value field
before entering the expression? If not, try it that way. The "Insert Formula"
dialog box will open up. You must check "Edit XPath (advanced)" button at the
bottom of the dialog box and then paste in the expression.

If this does not work, look and see whether you've got the correct nodes and
paths to the nodes in the expression. Since I do not know what your main data
source looks like, I'm unable to give you more pointers at this time.
---
S.Y.M. Wong-A-Ton


Erin said:
Thanks - I tried a number of variations but was unable to get it to work.
I'm not an XPath expert, so I easily may be missing something obvious. This
is literally what I put in as the default value:

current()/../preceding-sibling::my:EmployeeExpense[1]/my:Description

I also tried variations but nothing worked. I also checked the "Only to the
data rows a user inserts".

S.Y.M. Wong-A-Ton said:
Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


:

Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
S

S.Y.M. Wong-A-Ton

Yes, it does make a huge difference if your main data source is bound to a
database or not, since the namespaces used will differ from those used in a
form that is not bound to a database.

Your problem is two-fold as I see it: 1. You need to find out what the
namespaces are you need to use, and 2. You need to find the correct XPath
expression to the nodes.

Again, I'm searching in the dark if you do not provide more information on
the structure of your main data source. So here goes a wild guess; try the
following as the Default Value (enter as previously described):

current()/../preceding-sibling::d:EmployeeExpense[1]/@Description

And do not forget to uncheck the "Update this value when the result of the
formula is recalculated" checkbox on the Properties dialog box for the field
where you enter the default value.
---
S.Y.M. Wong-A-Ton


Erin said:
Yes, I used the Insert Formula dialog box to enter the formula (with "Edit
XPath (advanced)" checked). I'm at my wits end on this - I know it should be
very simple and appreciate any assistance you can give. One thing I didn't
mention previously is that my main data source is a SQL Server connection. I
don't know if that makes any difference.

I've also searched various other sites and posts and continue to try
variations, but nothing has worked.

Thanks,
Erin

S.Y.M. Wong-A-Ton said:
Did you first click on the Formula button behind the Default Value field
before entering the expression? If not, try it that way. The "Insert Formula"
dialog box will open up. You must check "Edit XPath (advanced)" button at the
bottom of the dialog box and then paste in the expression.

If this does not work, look and see whether you've got the correct nodes and
paths to the nodes in the expression. Since I do not know what your main data
source looks like, I'm unable to give you more pointers at this time.
---
S.Y.M. Wong-A-Ton


Erin said:
Thanks - I tried a number of variations but was unable to get it to work.
I'm not an XPath expert, so I easily may be missing something obvious. This
is literally what I put in as the default value:

current()/../preceding-sibling::my:EmployeeExpense[1]/my:Description

I also tried variations but nothing worked. I also checked the "Only to the
data rows a user inserts".

:

Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


:

Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
E

Erin

Well, your wild guess was dead on - that worked! Seems I tried all
variations of the syntax except that one.

Thanks so much for your help and patience!
Erin

S.Y.M. Wong-A-Ton said:
Yes, it does make a huge difference if your main data source is bound to a
database or not, since the namespaces used will differ from those used in a
form that is not bound to a database.

Your problem is two-fold as I see it: 1. You need to find out what the
namespaces are you need to use, and 2. You need to find the correct XPath
expression to the nodes.

Again, I'm searching in the dark if you do not provide more information on
the structure of your main data source. So here goes a wild guess; try the
following as the Default Value (enter as previously described):

current()/../preceding-sibling::d:EmployeeExpense[1]/@Description

And do not forget to uncheck the "Update this value when the result of the
formula is recalculated" checkbox on the Properties dialog box for the field
where you enter the default value.
---
S.Y.M. Wong-A-Ton


Erin said:
Yes, I used the Insert Formula dialog box to enter the formula (with "Edit
XPath (advanced)" checked). I'm at my wits end on this - I know it should be
very simple and appreciate any assistance you can give. One thing I didn't
mention previously is that my main data source is a SQL Server connection. I
don't know if that makes any difference.

I've also searched various other sites and posts and continue to try
variations, but nothing has worked.

Thanks,
Erin

S.Y.M. Wong-A-Ton said:
Did you first click on the Formula button behind the Default Value field
before entering the expression? If not, try it that way. The "Insert Formula"
dialog box will open up. You must check "Edit XPath (advanced)" button at the
bottom of the dialog box and then paste in the expression.

If this does not work, look and see whether you've got the correct nodes and
paths to the nodes in the expression. Since I do not know what your main data
source looks like, I'm unable to give you more pointers at this time.
---
S.Y.M. Wong-A-Ton


:

Thanks - I tried a number of variations but was unable to get it to work.
I'm not an XPath expert, so I easily may be missing something obvious. This
is literally what I put in as the default value:

current()/../preceding-sibling::my:EmployeeExpense[1]/my:Description

I also tried variations but nothing worked. I also checked the "Only to the
data rows a user inserts".

:

Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


:

Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
S

S.Y.M. Wong-A-Ton

Finally, the silver bullet! You're welcome; glad I could help.
---
S.Y.M. Wong-A-Ton


Erin said:
Well, your wild guess was dead on - that worked! Seems I tried all
variations of the syntax except that one.

Thanks so much for your help and patience!
Erin

S.Y.M. Wong-A-Ton said:
Yes, it does make a huge difference if your main data source is bound to a
database or not, since the namespaces used will differ from those used in a
form that is not bound to a database.

Your problem is two-fold as I see it: 1. You need to find out what the
namespaces are you need to use, and 2. You need to find the correct XPath
expression to the nodes.

Again, I'm searching in the dark if you do not provide more information on
the structure of your main data source. So here goes a wild guess; try the
following as the Default Value (enter as previously described):

current()/../preceding-sibling::d:EmployeeExpense[1]/@Description

And do not forget to uncheck the "Update this value when the result of the
formula is recalculated" checkbox on the Properties dialog box for the field
where you enter the default value.
---
S.Y.M. Wong-A-Ton


Erin said:
Yes, I used the Insert Formula dialog box to enter the formula (with "Edit
XPath (advanced)" checked). I'm at my wits end on this - I know it should be
very simple and appreciate any assistance you can give. One thing I didn't
mention previously is that my main data source is a SQL Server connection. I
don't know if that makes any difference.

I've also searched various other sites and posts and continue to try
variations, but nothing has worked.

Thanks,
Erin

:

Did you first click on the Formula button behind the Default Value field
before entering the expression? If not, try it that way. The "Insert Formula"
dialog box will open up. You must check "Edit XPath (advanced)" button at the
bottom of the dialog box and then paste in the expression.

If this does not work, look and see whether you've got the correct nodes and
paths to the nodes in the expression. Since I do not know what your main data
source looks like, I'm unable to give you more pointers at this time.
---
S.Y.M. Wong-A-Ton


:

Thanks - I tried a number of variations but was unable to get it to work.
I'm not an XPath expert, so I easily may be missing something obvious. This
is literally what I put in as the default value:

current()/../preceding-sibling::my:EmployeeExpense[1]/my:Description

I also tried variations but nothing worked. I also checked the "Only to the
data rows a user inserts".

:

Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


:

Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
P

p_wills

This works for me. However, my first row has to contain the number 2008.
Is it possible to make the xpath conditional somehow?
 
J

Jeremy

I need this two, I need the first row field to be the project start date, and
the 2nd row to be the phase start date from the 1st rows end date.

Start Date: End Date:
01/01/08 01/08/08
01/08/08 01/15/08

but this loops...

I get
01/01/08 01/08/08
01/01/08 01/08/08

I need the 2nd row's start date to be after the 1st rows end date. Like
Phases in a building project.
 
J

Jeremy

I get /../ for my:row[1] when I select the repeating group the fields are in.

S.Y.M. Wong-A-Ton said:
Try the following as the default value for "my:field1":

current()/../preceding-sibling::my:row[1]/my:field1

Here "my:row" is the repeating group and "my:field1" one of the fields in a
repeating row. Note: The expression looks like this when the "Edit XPath
(advanced) checkbox is checked.
---
S.Y.M. Wong-A-Ton


Erin said:
Forgive me if this has been asked before, but I couldn't find that it was. I
have a simple form with a single repeating table. When the user clicks to
add another row, I'd like to default several values from the previous row to
save possible re-entry. I have tried several things but couldn't get it to
work.

Please help -
Erin
 
Top