Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Anonymous
Not applicable

Cannot convert value null to type List

 2.PNGCapture.PNGHi, 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

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@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.

 

Vpazhenmsft_1-1630660200383.png

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.

Anonymous
Not applicable

@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.Capture.PNG

You can open the pbix -> Transform->Edit credentials-> anomymous

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.