Forum Discussion

namratapawale's avatar
namratapawale
Frequent Visitor
7 years ago
Solved

Retrieve username from current data connection

Hi,

 

I have a use case where I'm writing a custom M function that requires the username from the current data connector's connection. For example, I am connected to Teradata database using teradata database credentials, and I want to retrieve the username that was used while authenticating to Teradata database in my custom M function.

I'm defining this M function in custom data connector. I tried using Extension.CurrentCredential()[Username] to get the username from credentials but got the following error:

Expression.Error: We can only perform this operation while using a custom data connector.

 

Is there a way to do this?

 

Thanks,

Namrata

 

 

  • curth's avatar
    curth
    7 years ago

    By design (and for security reasons), it is not possible for queries to access credential information. 

4 Replies