How to add a field or group with an existing name? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to add a field or group with an existing name?

Last post 11-29-2004 11:04 AM by Greg Collins. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-19-2004 08:07 AM

    How to add a field or group with an existing name?

    I want to be able to add a node or an attribute via the right click Add option in the data source task bar that has the same name as an existing node or attribute. Infopath keeps giving me an error.

    Example:
    <root>
    <field1 name="">
    <field2 name="" />
    </field1>
    </root>

    Add attribute "name" to field2. The error is "A field or group with that name already exists. ..." It goes on to tell me to create a reference from the existing field or group to the new location in the datasource.

    Now, if I load a xml doc as the main data source, then it doesn't complain that I have fields or groups with same names.

    Is there an easy way to get around this or is the only way to modify the schema and the xml doc of the infopath form?
  • 11-19-2004 09:30 AM In reply to

    Re: How to add a field or group with an existing name?

    1. In the Data Source task pane, right-click the field that has the name that you want to use elsewhere in your schema, and then choose Reference.

    2. Select the destination field, and then click OK.

    Greg Collins [InfoPath MVP]
  • 11-19-2004 10:00 AM In reply to

    Re: How to add a field or group with an existing name?

    oh sorry, guess I was not quite clear. The name attribute is unique.

    Example:

    <root>
    <field1 name="John">
    <field2 name="Mike" />
    </field1>
    </root>


    When I try to add another attribute field called name, Infopath displays an error "A field or group with that name already exists."

    As I understand it, any changes you make to one field updates the other field automatically. Which is not what I want to do.

    Thanks for the help.
  • 11-20-2004 01:27 AM In reply to

    Re: How to add a field or group with an existing name?

    Hi Code Wizard,

    I think Greg's option might still work if you use a reference to name.

    Another alternative would be to create the xsd schema outside of InfoPath and load it into InfoPath. Using references ought to work here too.

    Good luck!
    Patrick Halstead
    Project Manager at Qdabra
  • 11-22-2004 05:32 PM In reply to

    Re: How to add a field or group with an existing name?

    Is this an internal or external schema? Meaning, was it created using InfoPath or by some other means?

    The solution I gave you will work if your schema was created in InfoPath. If not, you just need to follow standard schema design practices. I would suggest downloading a copy of XML Spy Home Edition for schema work.

    Greg Collins [InfoPath MVP]
  • 11-29-2004 06:13 AM In reply to

    Re: How to add a field or group with an existing name?

    I misunderstood the Infopath online help. I thought that the data (values) would be duplicated. But it turns out that only the node definition is duplicated.

    Thanks for the help.
  • 11-29-2004 11:04 AM In reply to

    Re: How to add a field or group with an existing name?

    If you want the data value to be identical in both, set a rule on one to populate the value of the other with the same value as the first.

    Greg Collins [InfoPath MVP]
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.