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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FlowViz
Helper III
Helper III

OData - We cannot convert the value null to type Text

Hi guys,

 

I have a .pbit that connects to Azure DevOps/Azure DevOps Server, which asks for the following details:

 

AzDO Services Login.png

 

 

 

 

 

 

 

 

I want to have Project field as optional, so if users leave it blank they can get data for all the projects in the organization, however when leaving it blank they get the following error.

 

Screenshot 2021-04-12 at 21.58.38.png

 

 

 

 

The query is:

 

= OData.Feed(#"Http/Https" & "://" & #"Analytics URL/Azure DevOps Server" & "/" & Organization & "/" & Project & "/_odata/v3.0-preview/WorkItems?%20$filter=WorkItemType%20ne%20%27Issue%27%20and%20WorkItemType%20ne%20%27Task%27%20and%20WorkItemType%20ne%20%27Test%20Case%27%20and%20WorkItemType%20ne%20%27Test%20Plan%27%20and%20WorkItemType%20ne%20%27Shared%20Parameter%27%20and%20WorkItemType%20ne%20%27Shared%20Steps%27%20and%20WorkItemType%20ne%20%27Test%20Suite%27%20and%20WorkItemType%20ne%20%27Impediment%27%20and%20State%20ne%20%27Removed%27%20&$select=AreaSK,CompletedDate,CompletedDateSK,CycleTimeDays,IterationSK,LeadTimeDays,ParentWorkItemID,State,StateCategory,TagNames,Title,WorkItemID,WorkItemType&$expand=Iteration($select=IterationName,IterationPath,StartDate,EndDate)", null, [Implementation="2.0"])

 

 

Is there any way around this to get it working?

2 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

Two potential approaches

 

1.  You start with a table of all Project names and then make the web call on each row, using the Project value on that row.  Prior to that step, you could have a Filter step that filters to the selected project (or null if not selected and no projects are filtered out. You could then expand the resulting tables to have your combined project data.

 

2.  If you can make a web call for all projects, you could have an if Project = null then OData.Feed( ) else OData.Feed()  with two different Odata calls.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-yingjl
Community Support
Community Support

Hi @FlowViz ,

Based on the error message, there have 'null' values in your data source which could not be converted to text type.

'null' value and blank value are different, refer: https://www.excelguru.ca/blog/2018/10/04/nuthin-aint-nuthin-in-power-query/ 

Please check your data type which includes 'null' value and replace values before you convert it to text type.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @FlowViz ,

Based on the error message, there have 'null' values in your data source which could not be converted to text type.

'null' value and blank value are different, refer: https://www.excelguru.ca/blog/2018/10/04/nuthin-aint-nuthin-in-power-query/ 

Please check your data type which includes 'null' value and replace values before you convert it to text type.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Employee
Employee

Two potential approaches

 

1.  You start with a table of all Project names and then make the web call on each row, using the Project value on that row.  Prior to that step, you could have a Filter step that filters to the selected project (or null if not selected and no projects are filtered out. You could then expand the resulting tables to have your combined project data.

 

2.  If you can make a web call for all projects, you could have an if Project = null then OData.Feed( ) else OData.Feed()  with two different Odata calls.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors