Can't get person field email in display form.
This has worked for several months, and resently stopped working.
i would usially call it like this:
fd.field('Manager').value.EntityData.Email
but now i get
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Email')
It sounds like the issue might be due to changes in the data structure or timing when accessing the Manager
field. Here are a few steps on how we would troubleshoot:
- Check the Data Structure: Add a log statement to inspect the
Manager
field's value:
console.log(fd.field('Manager').value);
- Ensure Timing: Make sure the code runs after the form is fully loaded using
fd.spRendered
. - Add Null Checks: Handle cases where the
Manager
field might be undefined or null.
By logging the field's value and checking its structure, you can identify if the expected data (like EntityData.Email
) is available and make adjustments accordingly.
Hope this helps!