Forum Discussion
Advanced Query Editor to change Salesforce Object Credentials
Hi
You should be able to get Salesforce data from multiple instances in the same dataset.
If you use the option get data from Salesforce and select "Custom" for both instances (even thougth they are production evironment, you need to select custom) and you add the url, you can select any object and combine the data.
You can use as URL the URL of your instance, for example:
etc
The M code should look like this 3 examples:
Query 1
let
Source = Salesforce.Data("https://cs85.salesforce.com/"),
Opportunity1 = Source{[Name="Opportunity"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(Opportunity1,{"Id", "Name"})
in
#"Removed Other Columns"
Query 2
let
Source = Salesforce.Data("https://emea.salesforce.com/"),
Opportunity1 = Source{[Name="Opportunity"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(Opportunity1,{"Id"})
in
#"Removed Other Columns"
Query 3
let
Source = Salesforce.Data("https://cs80.salesforce.com/"),
Opportunity1 = Source{[Name="Opportunity"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(Opportunity1,{"Id", "Name"})
in
#"Removed Other Columns"
In the examples, one of them is production and the other 2 are prelive. It is the same if all of them are production, you can add them as different Custom Salesforce data sources.
Regards