The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have this code in query powerbi desktop:
let
resource="https://graph.microsoft.com",
tokenResponse = Json.Document(Web.Contents("https://login.windows.net/",
[
RelativePath = #"Azure AD Tenant ID" & "/oauth2/token",
Content = Text.ToBinary(Uri.BuildQueryString(
[
client_id = #"Azure Application Client ID",
resource = resource,
grant_type = "client_credentials",
client_secret = #"Azure Application Client Secret"
]
)),
Headers = [Accept = "application/json"], ManualStatusHandling = {400}
])),
access_token = tokenResponse[access_token],
Source = OData.Feed("https://graph.microsoft.com/beta/users?$top=120&$select=id, prepaidUnits, servicePlans, deletedDateTime, accountEnabled, AgeGroup, assignedLicenses, assignedPlans, businessPhones, city, companyName, consentProvidedForMinor, country, createdDateTime, creationType, department, deviceKeys, displayName, employeeHireDate, employeeId, employeeOrgData, employeeType, externalUserState, externalUserStateChangeDateTime, faxNumber, givenName, identities, imAddresses, infoCatalogs, isResourceAccount, jobTitle, lastPasswordChangeDateTime, legalAgeGroupClassification, licenseAssignmentStates, mail, mailNickname, mobilePhone, officeLocation, onPremisesDistinguishedName, onPremisesDomainName, onPremisesExtensionAttributes, onPremisesImmutableId, onPremisesLastSyncDateTime, onPremisesProvisioningErrors, onPremisesSamAccountName, onPremisesSecurityIdentifier, onPremisesSyncEnabled, onPremisesUserPrincipalName, otherMails, passwordPolicies, passwordProfile, postalcode, preferredDataLocation, preferredLanguage, provisionedPlans, proxyAddresses, refreshTokensValidFromDateTime, showInAddressList, signInSessionsValidFromDateTime, state, streetAddress, surname, usageLocation, userPrincipalName, userType", [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"}, ODataVersion = 4, Implementation = "2.0" ]),
#"Expanded prepaidUnits" = Table.ExpandRecordColumn(Source, "prepaidUnits", {"enabled", "suspended", "warning"}, {"prepaidUnits.enabled", "prepaidUnits.suspended", "prepaidUnits.warning"}),
#"Expanded servicePlans" = Table.ExpandListColumn(#"Expanded prepaidUnits", "servicePlans"),
#"Expanded servicePlans1" = Table.ExpandRecordColumn(#"Expanded servicePlans", "servicePlans", {"servicePlanId", "servicePlanName", "provisioningStatus", "appliesTo"}, {"servicePlans.servicePlanId", "servicePlans.servicePlanName", "servicePlans.provisioningStatus", "servicePlans.appliesTo"})
in
#"Expanded servicePlans1"
and I got this error occur:
DataFormat.Error: We expected a property 'servicePlans', but the OData service omitted it from the response data. This can occur for a number of reasons and does not necessarily imply that the data does not exist or is of a default value.
Details:
Property=servicePlans
Any ideas how to fix this? Please help me, thank you.
@jennratten I reached this post because I have the same error, but in v1.0 version API.
When I make the request with manager expanded, ie:
my_url = "https://graph.microsoft.com/v1.0/users?$select=id,userPrincipalName&$expand=manager($levels=1;$selec...)",
graphData = OData.Feed(my_url, [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"}, ODataVersion = 4, Implementation = "2.0" ])
all users that doesn't have managers would come blank, but I got errors:
how could I solve or override this error?
Hello @PPNewbie - It looks like you could be having problems for a few different reasons - the API endpoint is beta (usability is not always reliable), the application may not have the right permission to view that property. Does the source step throw the error or is the error only present after one of the later steps?