0

enter image description herestrong text

want to access field "Text1" under "Row1" section. I can do it with $item.Fields["Text1"].Value enter image description here But there are another section which also contain Text1 field. How can access specific field under specific section.

1
  • 2
    You should first refactor your templates do not have duplicate field names. If you still can't get past that then use the field ID instead of the name. – Michael West Apr 1 at 17:01
2

This is impossible; you should use field IDs if you want to do this.

It would be best to name the two fields unique values.

https://doc.sitecore.com/developers/93/sitecore-experience-manager/en/the-template-field-template.html "Field names must be unique. If fields are defined on a single data template with the same name, then a validation error occurs when the data template is saved. But fields can also be inherited from base templates, so an item can potentially contain multiple fields with the same name. If this occurs, Sitecore displays both fields in the Content Editor, but programmers, who use the field name to retrieve contents when using the API and XSLT Renderings, might get unexpected results."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.