Comparing Fields with another field in Data validation

T

Tshelar

Hi Guys,
I have Repeate Table section Called Properties and it has mulitple Property
fields in it. How can I compare one field to another for Data validation.
Example: Property A (field) with Property B(field).
Any tips. So far I have tried every thing in the Data validation dialog box
including XPath expression, but nothing has worked.
 
T

Tshelar

Hi Greg,
The fields are in different rows.

Here is what I am trying to do. The repeating table gets the data(rows) from
a group called "property". So for example If I represent them as Xpath
expression they are as follows.

.../sox:property["PropertyA"]/@value
.../sox:property["PropertyB"]/@value

(@Value is the attribute)

PropertyA and PopertyB are in separate rows. I want to put a data validation
on the text box that is bounded to PropertyB where I need to compare the
value(@value) of PropertyA with PropertyB.

Thanks for the prompt reply.
Tushar
 
T

Tshelar

Thanks a lot Greg. As you said the Xpath was invalid. I changed the Xpath to
sox:property[@name = "PropertyA"]/@value and it works like a charm. The
Property node has attributes "name" and "value".
I appreciate your help.

Greg Collins said:
Your XPaths are invalid. XPath doesn't support syntax such as sox:property["PropertyA"]

I'm assuming the node sox:property holds a value and that value is "PropertyA". Property also has an attribute named "value".

If this is the case, then you would use something like:

sox:property[. = "PropertyA"]/@value

What this is saying is: Find the node named sox:property whose value is "PropertyA" and get its attribute named value.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi Greg,
The fields are in different rows.

Here is what I am trying to do. The repeating table gets the data(rows) from
a group called "property". So for example If I represent them as Xpath
expression they are as follows.

.../sox:property["PropertyA"]/@value
.../sox:property["PropertyB"]/@value

(@Value is the attribute)

PropertyA and PopertyB are in separate rows. I want to put a data validation
on the text box that is bounded to PropertyB where I need to compare the
value(@value) of PropertyA with PropertyB.

Thanks for the prompt reply.
Tushar



Greg Collins said:
Are the fields within the same row of the repeating table? Or are you trying to compare fields from different rows?

If they are on the same row it should be straight forward. If they are on different rows, that can be very complex depending on what you want to do.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi Guys,
I have Repeate Table section Called Properties and it has mulitple Property
fields in it. How can I compare one field to another for Data validation.
Example: Property A (field) with Property B(field).
Any tips. So far I have tried every thing in the Data validation dialog box
including XPath expression, but nothing has worked.
 
Top