0

I am using Mgt-people-picker and there is a very intermittent issue. There is a need to pre-populate users by passing the email address some can be users from same azure tenant and some can be any external email addresses. When passing array of email address to the people picker the below error comes up

    at JSON.parse (<anonymous>)
    at graph.user.ts:198:19
    at u (runtime.js:63:40)
    at Generator._invoke (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at i (16.5f455671.chunk.js:2:615193)```
MaheSH YU
  • 27
  • 6
  • Could you please provide more details? Could you please provide any repro steps or sample code referred? – Prasad-MSFT May 24 '22 at 04:25
  • This is the how I am using the mgt people picker The defaultSelectedUsers is an array of email address strings – MaheSH YU May 24 '22 at 11:04
  • This is a very intermittent issue when we invoke our app in Teams, it does not populate any users in people picker even if the user is in the same tenant or any external email addres It gives error in the browser console I have mentioned in the original post – MaheSH YU May 24 '22 at 11:06
  • Could you please provide more details on the error? It's not much clear. Console error what you are getting? Any SS of the error? – Prasad-MSFT May 25 '22 at 08:57
  • This is the complete error message from browser Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse () at graph.user.ts:198:19 at u (runtime.js:63:40) at Generator._invoke (runtime.js:294:22) at Generator.next (runtime.js:119:21) at i (16.08960254.chunk.js:2:610344) – MaheSH YU May 25 '22 at 13:21
  • I am just passing an array of user email as to the defaultSelectedUserIds – MaheSH YU May 25 '22 at 13:23
  • Could you please try once with AAD Object Id (UserId) instead of email adress?https://learn.microsoft.com/en-us/graph/toolkit/components/people-picker#properties – Prasad-MSFT May 26 '22 at 09:42
  • Adding the userID is not giving any issue, however we were passing the email address for past few weeks which worked. Were there any major changes to this component that is stopping us from passing email address? – MaheSH YU May 26 '22 at 11:58
  • Not sure about that. There might be some changes at SDK side – Prasad-MSFT May 27 '22 at 08:24
  • What would you suggest on this? Passing the UserIDs instead – MaheSH YU May 27 '22 at 08:35
  • Yes that will be better way – Prasad-MSFT May 30 '22 at 06:55
  • I can try that, but this is very intermittent. Sometimes it works with email address too. not sure if this will work for sure with userIds – MaheSH YU Jun 07 '22 at 07:54

0 Answers0