Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi, I'm importing the data through an API when I click on refresh it thorws an error stating "Cannot convert value null to type List"
please help I've attached pbix and screenshots below.
This is M code I'm using rn:
let
Source = List.Generate( ()=> [Result= try PageData(1) otherwise null, PageNumber = 1], each List.Count([Result]) >1, each [Result= try PageData([PageNumber]) otherwise null, PageNumber = [PageNumber] +1], each [Result]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandListColumn(#"Converted to Table", "Column1"),
#"Expanded Column2" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1", {"id", "summary", "recordType", "board", "status", "company", "site", "siteName", "addressLine1", "city", "stateIdentifier", "zip", "country", "contact", "contactName", "contactPhoneNumber", "contactEmailAddress", "type", "team", "owner", "priority", "serviceLocation", "source", "severity", "impact", "allowAllClientsPortalView", "customerUpdatedFlag", "automaticEmailContactFlag", "automaticEmailResourceFlag", "automaticEmailCcFlag", "closedDate", "closedBy", "closedFlag", "actualHours", "approved", "estimatedExpenseCost", "estimatedExpenseRevenue", "estimatedProductCost", "estimatedProductRevenue", "estimatedTimeCost", "estimatedTimeRevenue", "billingMethod", "subBillingMethod", "dateResolved", "dateResplan", "dateResponded", "resolveMinutes", "resPlanMinutes", "respondMinutes", "isInSla", "resources", "hasChildTicket", "hasMergedChildTicketFlag", "billTime", "billExpenses", "billProducts", "location", "department", "mobileGuid", "sla", "currency", "_info", "customFields", "agreement", "contactPhoneExtension", "automaticEmailCc", "subType", "item", "opportunity", "poNumber", "budgetHours", "parentTicketId", "mergedParentTicket", "addressLine2", "billingAmount", "knowledgeBaseLinkId", "knowledgeBaseLinkType"}, {"id", "summary", "recordType", "board", "status", "company", "site", "siteName", "addressLine1", "city", "stateIdentifier", "zip", "country", "contact", "contactName", "contactPhoneNumber", "contactEmailAddress", "type", "team", "owner", "priority", "serviceLocation", "source", "severity", "impact", "allowAllClientsPortalView", "customerUpdatedFlag", "automaticEmailContactFlag", "automaticEmailResourceFlag", "automaticEmailCcFlag", "closedDate", "closedBy", "closedFlag", "actualHours", "approved", "estimatedExpenseCost", "estimatedExpenseRevenue", "estimatedProductCost", "estimatedProductRevenue", "estimatedTimeCost", "estimatedTimeRevenue", "billingMethod", "subBillingMethod", "dateResolved", "dateResplan", "dateResponded", "resolveMinutes", "resPlanMinutes", "respondMinutes", "isInSla", "resources", "hasChildTicket", "hasMergedChildTicketFlag", "billTime", "billExpenses", "billProducts", "location", "department", "mobileGuid", "sla", "currency", "_info", "customFields", "agreement", "contactPhoneExtension", "automaticEmailCc", "subType", "item", "opportunity", "poNumber", "budgetHours", "parentTicketId", "mergedParentTicket", "addressLine2", "billingAmount", "knowledgeBaseLinkId", "knowledgeBaseLinkType"}),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Expanded Column2", {{"closedDate", type datetime}}, "en-US"),
#"Changed Type" = Table.TransformColumnTypes(#"Changed Type with Locale",{{"actualHours", type number}, {"closedDate", type date}})
in
#"Changed Type"
Pbix link :
https://drive.google.com/file/d/1qvuvLt3VPm6eU3103qWil47LJZivZZu0/view?usp=sharing
@Anonymous
I can't open your pbix.
You can check the column with the error to see if there is a null value in it, if there is a null value, replace it with Replace Values.
Transform -- Replace Values.
This is a link to related content, hope it will help you:
https://community.powerbi.com/t5/Desktop/Cannot-convert-value-null-to-type-List/m-p/893014
https://community.powerbi.com/t5/Power-Query/Cannot-convert-to-type-List/m-p/1971275
Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@V-pazhen-msft thank you for responding.
Can you open the pbix I can't perform replace values it is giving me the error at the source when I'm trying to get the data through API.
You can open the pbix -> Transform->Edit credentials-> anomymous
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |