Forum Discussion

ben1's avatar
ben1
New Member
8 years ago

Connect to multiple Salesforce orgs at the same time?

I am testing Power BI. The Salesforce connector works well.

 

However, we have multiple Salesforce orgs and I am wodnering if it is possible to connect to each of them and pull data from each org into a single dashboard?

 

For example, if I pull in a report on all Opportunities, there will be some overlap of customers. If two opportunites are linked to a contact with the same email address (even though in different salesforce orgs), then can Power BI report on this?

 

Thanks

11 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I had the same issue for my dataflows and did something similar to what is suggested in some responses above, but in the M-code.

     

    By default, Power Query will produce the following code:

    Source = Salesforce.Data(),

     

    You can replace by:

    Source = Salesforce.Data("https://yourdomainname.my.salesforce.com"),

     

    Replacing "yourdomainname" with yours. Once this is done, Power Query will ask to authentificate, and redirect you to https://yourdomainname.my.salesforce.com.

     

    If you have multiple Salesforce org under the same sub-domain as stated above (e.g. NA01.salesforce.com), a solution can be to setup "My Domain" feature in Salesforce setup. Doing so, you will choose the subdomain you want, that has to be unique.

    Then, you will be able to put this unique login url in you m-code.

  • kwdavis7's avatar
    kwdavis7
    Frequent Visitor

    Finally figured it out! The key is when putting in the url for the custom option to connect that you use the format https://[yourdomain].my.salesforce.com instead of what you may actually see in the url when logging into Salesforce. For example when I log into Sales my url looks like the image below (domain blocked out for security).


    But when I go to Get Data > Salesforce Reports > URL Custom I have to type it in as https://[yourdomain].my.salesforce.com
    Basically changing ".lightning.force.com" to ".my.salesforce.com"

    Hope that helps.

  • Hi ben1

     

    You should be able to do it by using \get data\from Salesforce and seect "custom" instead of "production".

    "Custom" option allows you to connect to a Sandbox and to Production.

    You need to add the url of your "production" environment (like https://eu14.salesforce.com/)

    If you have more than one instance of SFDC in the same environment, you can use "login.salesforce.com", "emea.salesforce.com, etc.

    Pablo

    • ben1's avatar
      ben1
      New Member

      Hi pablobarra

       

      I tried that. When I click Get Data -> Salesforce for the first time, it asks me to login, and I can then connect without trouble.

       

      However, if I go to Get Data -> Salesforce for a second time, it automatically uses my existing credential and doesn't give any option to enter a different one.

      • pablobarra's avatar
        pablobarra
        Icon for Advocate I rankAdvocate I

        Hi ben1

        Did you selected "Custom" when selecting the environment?

        Select Custom and use different URL each time, for example https://login.salesforce.com, https://e10.salesforce.com/, etc.

        You will be able to find you Salesforce URL in the UI. 

        Use different URL, for example login.salesforce.com and emea.salesforce.com can work with your instance, try if that is the case, and if so, you can use them as different "custom" connections.

        Pablo

         

    • andreamastrini's avatar
      andreamastrini
      Frequent Visitor

      Hi -

      I have 3 Salesforce orgs to connect and I unfortunately selected "Production" while connecting the fist one. I tried to export the dataflow to json and import it as a Model into a second dataflow but PowerBI doesn't give me the option to select the credentials for each org.

      What am I supposed to do? Recreate the (long) dataflow coping and pasting the M code for each table OR there 's a central place where to manage Salesforce org's credentials in PBI service?

      Thanks!

      Andrea

  • Anonymous's avatar
    Anonymous
    Not applicable

    Running into the same issue. 

    I can only login to my instances by using https://login.salesforce.com as the default URL to login. I can do that and log in with username and password 1, and get the data that is associated with that account. I can do that and log in with username and password 2, and get the data that is associated with that account. But I cannot create one connection where I login with username and password 1 and a separate connection where I log in with username 2 in order to to pull the data from both logins.