DynamicForm does not load or save correctly when field name starts with special character #1077
Labels
status:fixed-next-drop
Issue will be fixed in upcoming release.
Milestone
Category
[ ] Enhancement
[*] Bug
[ ] Question
Version
Please specify what version of the library you are using: [3.5.0]
Expected Behavior
DynamicForm should display and save all field values, regardless of internal field name in SharePoint
Observed Behavior
When a field is created in SharePoint with a special character at the start of the field name, SharePoint replaces this character with a unicode representation like
\_x####\_
- where #### is the unicode character reference. For example: if you name a field "% Complete" - SharePoint will call this field "_x0025_Complete" internally. To complicate matters further, the property returned from the API will be named "OData__x0025_Complete". At present, because of this difference, fields named in this way will not work in DynamicForm.This does not affect fields where a special character is used in the middle or at the end of the field name. Only those used at the beginning.
Steps to Reproduce
Proposed Solution
The necessary data to fix this issue is already being retrieved. Instead of using
field.InternalName
, usefield.EntityPropertyName
. In most cases this matchesfield.InternalName
- but it also matches the field property name as the SharePoint API expects it.So on DynamicForm.tsx#L326 use:
and on DynamicForm.tsx#L458 use:
The text was updated successfully, but these errors were encountered: