Fix- Issue 1421- PeoplePicker Control - Shows wrong value in Dynamic Form when null is provided & Issue 1578 - DynamicForm - Error on save when clearing person from Person or Group field and leaving it blank. #1570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's in this Pull Request?
Fixing the issue 1421 & 1380, Validating the
Null
in the user's name or email.Fixing issue 1578, Error on save when clearing person from Person or Group field and leaving it blank.
Solution for Issue #1421
I have created a few users in my tenant, with the below mentioned names and email's
Added two columns in my test list, one as multi user, and single user respectively, and added the users to the list item as below.
I have also added extra validation at
SPService.ts
for the methods,getUsersUPNFromFieldValue
&getUserUPNFromFieldValue
to get the output as below.Solution for Issue #1578
When the user is updating the people picker column, for a single user, Dynamic form is throwing error while saving the list item. The issue occurs at method
onSubmitClick
The object formed with an empty user and is being submitted to update the item
And the error is caught here,
By validating the null check as below, the issue is resolved.
I have also corrected a spelling mistake at
onSubmitClick
from, 'val.newValue.lenght'
To, 'val.newValue.length' as below.
Thanks,
Nishkalank Bezawada