Forum Discussion

jaime_blackwell's avatar
5 years ago

Error with Power BI Custom Connector -cannot convert a value of type Function to type Text.

Hi All,

 

I'm building a custom connector for Power BI that queries Xero's API. 

When used in Power BI the connector returns an error after successful authentication "We cannot convert a value of type Function to type Text."

When I test the connector in Visual Studio I get the error "Set is undefined" after successful authentication. 

Code for my connector is here: https://gist.github.com/jaimeblackwell/1e510ba24c4d71a0c5a6902e29e2da5b

 

I've tried wrapping my variables in functions such as Text.From() but the same error still occurs. Any assistance or feedback will be greatly appreciated!

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI jaime_blackwell,

    This seems like a common error notice, and it appears when you try to do type conversions or use M query functions with wrong data types.

    In my opinion, I'd like to suggest you add some 'debug output' codes into your connector to output the logs to the debug panel and help you trace/locate the M query processing steps. (it should help us to find out which steps cause the issue)

    Regards,

    Xiaoxin Sheng