Forum Discussion
FlorianF
3 years agoFrequent Visitor
Error null cannot converted to text (but there is no null value in column)
Hi guys, I have a strange error in Power BI. It says that a null value cannot be converted into text. But the column where the error disappears is not a datatype text, and also there is no null val...
- 3 years ago
Ok, update the highlighted section to be:
each try f_archivedEmails([id]) otherwise nullPete
FlorianF
3 years agoFrequent Visitor
Thanks! I found out what the reason for the error was.
But to fix it, I need to update my function that it only runs the query when the number is not null.
How can I achieve this? Tried it with if statement, but I'm pretty new and do not know how to correctly add an if statement here.
(Customer as number) =>
let
Quelle = Json.Document(Web.Contents("https://ffbc.weclapp.com/webapp/api/v1/archivedEmail?entityId=" & Number.ToText(Customer) & "&entityName=party&pageSize=1000"))
in
Quelle
- BA_Pete3 years agoSuper User
I think you would apply the conditional at the point of calling the function, rather than changing the function iteself, something like:
if [Customer] <> null then myFunction([Customer]) else nullPete