Repeating Table values

J

JenniferLee

First of all, I am not a programmer!
I am creating a form to order computer hardware. A repeating table includes
a drop down list where people can choose to order a monitor, desktop
computer, notebook computer, printer, etc. I am trying to do a conditional
format where if a person chooses a notebook computer, the default value of a
text box below changes to read "VP approval required". Otherwise, it should
read "Supervisor approval required." The problem is, people can add rows to
the repeating table and order a notebook computer, a printer, a scanner, etc.
all on the same form. How can I conditionally set this so that if any one of
the values in the repeating table is "notebook" then the text box reads "VP
approval required"?

As it is now, the last selected value in the repeating table determines the
value of the text box.

If there is any programming required, please be specific as I am not a
programmer. Thanks.
 
J

JenniferLee

Thanks, but although that is a great procedure, it is not what I am trying to
do. Perhaps I did not explain properly or perhaps it cannot be done.

This is a form that must be printed out and hand-signed at the bottom of the
page by a person in authority. Normally, that person is a Supervisor, and so
there is a space for a signature with a text box that specifies "Supervisor".

However, if the order includes a Notebook computer, then the signer must be
a VP; a Supervisor signature is not acceptable, and so I would like the
signature line text box to specify the VP approval requirement. It doesn't
matter what else they order, just the fact that they are requesting a
Notebook requires a higher level signature.

The orderer can use rows of a repeating table to request any number of
hardware items, selecting from a list of values I typed to populate a drop
down list. I want to find a way to have Infopath look at all the values
selected in the rows of the repeating table, and if any one of those values
selected is "Notebook", then and only then should the text box by the
signature line change to "VP approval required."

Keep in mind that a person may choose "Notebook" by accident and then
deselect it and choose "Desktop" or "Printer" or some other item instead - -
and then the signature line text box must change back to "Supervisor" when
"Notebook" is removed. So a simple rule that changes the text box to "VP"
as soon as "Notebook" is chosen is not enough because it will not provide for
removal of the Notebook selection and change the text box back to Supervisor.

A rule that runs each time a hardware item is selected will not work because
someone may choose"Notebook" (text box changes to "VP") and then choose
"Printer" in the next row (text box changes to "Supervisor" when I want it to
still read "VP" because the Notebook is still selected in the previous row.)

Our current form in Word just has text on it stating that a VP signature is
required to purchase a notebook computer. Most people claim they never saw
it and turn in the form with a supervisor signature although they are
requesting a Notebook. So I want the signature line to specify either a VP
or a Supervisor, all dependent on whether or not they are requesting a
Notebook computer.

Thanks!
 
S

S.Y.M. Wong-A-Ton

I still think you can do this without custom code. What you probably need to
use is a technique I described in this solution
(http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm)
using a helperField.

Add a text field called "helperField" to the main node of your form
(myFields). Then add 2 rules to the field in the repeating table. The first
rule should set "helperField" to an empty string and the second rule to
anything that's not an empty string, e.g. the text "process". Then you must
add 2 rules to "helperField": One that sets the text box to "Supervisor" and
another one that sets it to "VP". On the rule that sets the text box to "VP"
you must add a condition that says something like:

count(../my:repeatinggroup/my:repeatingtablefield[text()='Notebook']) > 0

You must type this expression in yourself. First you must select the field
of the repeating table on the Condition dialog box, then select "The
expression" from the first drop-down list box, and then modify the expression
to include count(...) > 0

Then add a condition to the rule that sets the text box to "Supervisor", but
instead of count(...) > 0, use count(...) = 0

I've written this from the top of my head, so if it doesn't work, let me know.
 
J

JenniferLee

Oh my, oh my! This is so cool. It works perfectly. Really slick. You are
a marvel!

Our department head handed me a beginner book on InfoPath, said "Read this
and we need six forms by next week." Ha ha. That was five weeks ago. I'm
bound and determined to do them right, not just slap text boxes on a page. I
learned a lot by your examples - very valuable assistance. Thanks again.

Jennifer

S.Y.M. Wong-A-Ton said:
I still think you can do this without custom code. What you probably need to
use is a technique I described in this solution
(http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm)
using a helperField.

Add a text field called "helperField" to the main node of your form
(myFields). Then add 2 rules to the field in the repeating table. The first
rule should set "helperField" to an empty string and the second rule to
anything that's not an empty string, e.g. the text "process". Then you must
add 2 rules to "helperField": One that sets the text box to "Supervisor" and
another one that sets it to "VP". On the rule that sets the text box to "VP"
you must add a condition that says something like:

count(../my:repeatinggroup/my:repeatingtablefield[text()='Notebook']) > 0

You must type this expression in yourself. First you must select the field
of the repeating table on the Condition dialog box, then select "The
expression" from the first drop-down list box, and then modify the expression
to include count(...) > 0

Then add a condition to the rule that sets the text box to "Supervisor", but
instead of count(...) > 0, use count(...) = 0

I've written this from the top of my head, so if it doesn't work, let me know.
---
S.Y.M. Wong-A-Ton


JenniferLee said:
Thanks, but although that is a great procedure, it is not what I am trying to
do. Perhaps I did not explain properly or perhaps it cannot be done.

This is a form that must be printed out and hand-signed at the bottom of the
page by a person in authority. Normally, that person is a Supervisor, and so
there is a space for a signature with a text box that specifies "Supervisor".

However, if the order includes a Notebook computer, then the signer must be
a VP; a Supervisor signature is not acceptable, and so I would like the
signature line text box to specify the VP approval requirement. It doesn't
matter what else they order, just the fact that they are requesting a
Notebook requires a higher level signature.

The orderer can use rows of a repeating table to request any number of
hardware items, selecting from a list of values I typed to populate a drop
down list. I want to find a way to have Infopath look at all the values
selected in the rows of the repeating table, and if any one of those values
selected is "Notebook", then and only then should the text box by the
signature line change to "VP approval required."

Keep in mind that a person may choose "Notebook" by accident and then
deselect it and choose "Desktop" or "Printer" or some other item instead - -
and then the signature line text box must change back to "Supervisor" when
"Notebook" is removed. So a simple rule that changes the text box to "VP"
as soon as "Notebook" is chosen is not enough because it will not provide for
removal of the Notebook selection and change the text box back to Supervisor.

A rule that runs each time a hardware item is selected will not work because
someone may choose"Notebook" (text box changes to "VP") and then choose
"Printer" in the next row (text box changes to "Supervisor" when I want it to
still read "VP" because the Notebook is still selected in the previous row.)

Our current form in Word just has text on it stating that a VP signature is
required to purchase a notebook computer. Most people claim they never saw
it and turn in the form with a supervisor signature although they are
requesting a Notebook. So I want the signature line to specify either a VP
or a Supervisor, all dependent on whether or not they are requesting a
Notebook computer.

Thanks!
 
S

S.Y.M. Wong-A-Ton

I like to see people get excited about InfoPath. :) It has its weaknesses,
but it's still a great product. Glad you got your form to work and glad to
have helped.
---
S.Y.M. Wong-A-Ton


JenniferLee said:
Oh my, oh my! This is so cool. It works perfectly. Really slick. You are
a marvel!

Our department head handed me a beginner book on InfoPath, said "Read this
and we need six forms by next week." Ha ha. That was five weeks ago. I'm
bound and determined to do them right, not just slap text boxes on a page. I
learned a lot by your examples - very valuable assistance. Thanks again.

Jennifer

S.Y.M. Wong-A-Ton said:
I still think you can do this without custom code. What you probably need to
use is a technique I described in this solution
(http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm)
using a helperField.

Add a text field called "helperField" to the main node of your form
(myFields). Then add 2 rules to the field in the repeating table. The first
rule should set "helperField" to an empty string and the second rule to
anything that's not an empty string, e.g. the text "process". Then you must
add 2 rules to "helperField": One that sets the text box to "Supervisor" and
another one that sets it to "VP". On the rule that sets the text box to "VP"
you must add a condition that says something like:

count(../my:repeatinggroup/my:repeatingtablefield[text()='Notebook']) > 0

You must type this expression in yourself. First you must select the field
of the repeating table on the Condition dialog box, then select "The
expression" from the first drop-down list box, and then modify the expression
to include count(...) > 0

Then add a condition to the rule that sets the text box to "Supervisor", but
instead of count(...) > 0, use count(...) = 0

I've written this from the top of my head, so if it doesn't work, let me know.
---
S.Y.M. Wong-A-Ton


JenniferLee said:
Thanks, but although that is a great procedure, it is not what I am trying to
do. Perhaps I did not explain properly or perhaps it cannot be done.

This is a form that must be printed out and hand-signed at the bottom of the
page by a person in authority. Normally, that person is a Supervisor, and so
there is a space for a signature with a text box that specifies "Supervisor".

However, if the order includes a Notebook computer, then the signer must be
a VP; a Supervisor signature is not acceptable, and so I would like the
signature line text box to specify the VP approval requirement. It doesn't
matter what else they order, just the fact that they are requesting a
Notebook requires a higher level signature.

The orderer can use rows of a repeating table to request any number of
hardware items, selecting from a list of values I typed to populate a drop
down list. I want to find a way to have Infopath look at all the values
selected in the rows of the repeating table, and if any one of those values
selected is "Notebook", then and only then should the text box by the
signature line change to "VP approval required."

Keep in mind that a person may choose "Notebook" by accident and then
deselect it and choose "Desktop" or "Printer" or some other item instead - -
and then the signature line text box must change back to "Supervisor" when
"Notebook" is removed. So a simple rule that changes the text box to "VP"
as soon as "Notebook" is chosen is not enough because it will not provide for
removal of the Notebook selection and change the text box back to Supervisor.

A rule that runs each time a hardware item is selected will not work because
someone may choose"Notebook" (text box changes to "VP") and then choose
"Printer" in the next row (text box changes to "Supervisor" when I want it to
still read "VP" because the Notebook is still selected in the previous row.)

Our current form in Word just has text on it stating that a VP signature is
required to purchase a notebook computer. Most people claim they never saw
it and turn in the form with a supervisor signature although they are
requesting a Notebook. So I want the signature line to specify either a VP
or a Supervisor, all dependent on whether or not they are requesting a
Notebook computer.

Thanks!



:

No custom code required! You need to look into using current(). For an
example of its use, see
http://enterprise-solutions.swits.net/infopath/shrinking-dropdown-list-repeating-table.htm
---
S.Y.M. Wong-A-Ton


:

First of all, I am not a programmer!
I am creating a form to order computer hardware. A repeating table includes
a drop down list where people can choose to order a monitor, desktop
computer, notebook computer, printer, etc. I am trying to do a conditional
format where if a person chooses a notebook computer, the default value of a
text box below changes to read "VP approval required". Otherwise, it should
read "Supervisor approval required." The problem is, people can add rows to
the repeating table and order a notebook computer, a printer, a scanner, etc.
all on the same form. How can I conditionally set this so that if any one of
the values in the repeating table is "notebook" then the text box reads "VP
approval required"?

As it is now, the last selected value in the repeating table determines the
value of the text box.

If there is any programming required, please be specific as I am not a
programmer. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top