Hi All,
I am trying to get azure ad user properties using "Invoke an HTTP request".
If the field/property has value then returning the field with value is fine, but the field/property is blank/null connector is not returning the column itself and returns an error saying that the column does not exist.
but in Explorer, it returns null. in power automate "Invoke an HTTP request" connector is not returning any null or blank. it returns an error.
from power automate
if you observe from the error screenshot, the company name field itself does not exist as it says.
first of all the "Invoke an HTTP request" itself does not return the Company Name field
here is the connector API Query
https://graph.microsoft.com/v1.0/users/88e356d7-fca8-4124-90b6?$select=displayName,mail,userPrincipalName,companyName
here is the response to the above REST API connector it self Company name is excluding because of user property company name is blank/null, if value exist then its returning as expected
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(displayName,mail,userPrincipalName,companyName/$entity",
"displayName": "sample",
"mail": "sample@outlook.com",
"userPrincipalName": "sample",
"id": "88e356d7-fca8-4124-90b6",
}
In fact, if we try for another user who has the value from the backend then it gets the company name itself.
how to get field value even if it is blank and assign to Select action. because only a few users do not have the Company Name values.
any help here, please
Solved! Go to Solution.
Hey @muralikrishna12
For this you can try one of the two things. I hope atleast one works for you. 😅
1) Condition Action:
So, the condition action will check that your json data contains a value as companyName or not.
If it has make a select action for including it.
And if it does not have it, then make a select action excluding it.
2) To use if inside the selection. Not sure this one would work or not.
Write this expression, or somewhat similar expression:
I hope atleast one works for you. Change some fields or name according to your case.
If this works for you, you can accept the answer as the solution and if you liked the explanation or even appreciate the effort please give a thumbs up. 🙂
Hey @muralikrishna12
For this you can try one of the two things. I hope atleast one works for you. 😅
1) Condition Action:
So, the condition action will check that your json data contains a value as companyName or not.
If it has make a select action for including it.
And if it does not have it, then make a select action excluding it.
2) To use if inside the selection. Not sure this one would work or not.
Write this expression, or somewhat similar expression:
I hope atleast one works for you. Change some fields or name according to your case.
If this works for you, you can accept the answer as the solution and if you liked the explanation or even appreciate the effort please give a thumbs up. 🙂
I think I need to show the screenshot of the flow actions. because Invoke an HTTP request connector itself does not return the company field, if the connector returns the company name either blank/null then we can format it in the select query using the If condition.
Please check the screen, after the connector
I am setting values into an array to bind and converting them into an array to select each field.
how do check whether a field exists or not from the array,
this way we can check first if field find then we can understand company name is not blank,
if Company Name is not found in the array then we can understand and use a select query with the out Company name.
Please reply
In the above methods, I am first checking if the field is present only. In your case in the condition action, just pass the variable.
So, just follow the steps I told in the above message.
So for everyone coming in future to check out the post. The better technique to use for this would be a
Then using coalesce function in select:
Expression:
Final Output:
Thanks @Pstork1 for the approach. 🙂