0

I'm encountering an issue with my application's Office365Users.DirectReports function. The error message states:

office365users.directreports failed: the function 'directreports' has an invalid value for parameter 'userid' - a blank value was passed to it where it was not expected. Please make sure that a valid argument is passed to the function.

To provide some context, I'm using a text field where the manager's email is entered and the Office365Users.DirectReports function should return the direct reports:

Office365Users.DirectReports(Head_Department_Name.Value)

The application runs fine, but this error appears during data loading, and I need to hide this notification.

Could anyone advise on how to prevent this error or hide the notification?

Thanks in advance for your help!

I tried to modify the following code but without success:

If(!IsBlank(ThisItem.CreatedByUser),
   Office365Users.UserProfile(ThisItem.CreatedByUser).DisplayName
)

1 Answer 1

0

Your code is showing this error because while loading the app, it checks the parameter (Head_Department_Name.Value) which initially turns out to be blank. Adding just a simple check will make the error go away. Following is an example:

If(!IsBlank(Head_Department_Name.Value),
   Office365Users.DirectReports(Head_Department_Name.Value)
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.