-
Hi all, I am creating a project that uses a Power App to call the Microsoft Graph API. The idea is to return only those users who have an Employee Type of Contractor. Using the Graph Explorer I'm able to use the following query that returns only users which are Contractors: I have registered an app in the Azure Active Directory and created a custom connector with one Action called GetUsers for my Power App. For testing, in the Power App I just have a button and trying to use the following command on the OnSelect.
I'm getting an error in the Power App contextual help that is saying there are some invalid arguments. I'm not sure how to pass in the parameters syntax in for the ClearCollect. After created the custom connector it seems there are three parameters required. $filter Thank you for any help you can provide or point me in the right direction to! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
As you're building a Power App, I assume your work is not related to this hack because it's not using .NET. Instead you're submitting a generic question, correct? Let me ask around for you if anyone knows what could be wrong. |
Beta Was this translation helpful? Give feedback.
-
Heya @greddin, happy to help :-) Few questions:
|
Beta Was this translation helpful? Give feedback.
-
If you like to, ping me on Twitter @LuiseFreese or LinkedIn https://linkedin.com/in/luisefreese and then I can give you my email so that I could jump on a quick Teams call with you.
Luise Freese
Here's my attempt now. Do I need to enter the parameter names as well?
[powerapp-error]<https://user-images.githubusercontent.com/967815/222754674-c17439ae-6dc8-4cd0-838c-2de7fd4fff5c.png>
|
Beta Was this translation helpful? Give feedback.
-
Thanks to @LuiseFreese for helping solve my issue! My main issue was that the employeeType was not getting returned in the response. So the Power App would error. We simplified the Graph query in the Explorer to: We then updated the Collection in the Power App to Filter on employeeType="Contractor". Thank you again @LuiseFreese for all your help! -Greg |
Beta Was this translation helpful? Give feedback.
Thanks to @LuiseFreese for helping solve my issue!
My main issue was that the employeeType was not getting returned in the response. So the Power App would error. We simplified the Graph query in the Explorer to:
https://graph.microsoft.com/v1.0/users?$select=employeeType,id,displayName
We then updated the Collection in the Power App to Filter on employeeType="Contractor".
ClearCollect(Contractors, Filter('graph-user-contractors'.GetUsers({'$select':"employeeType,id,displayName"}).value,employeeType="Contractor"))
Thank you again @LuiseFreese for all your help!
-Greg