We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi ,
It would be great if anyone can help me on this :
I want to fetch data from sales force (few tables row count) ,For that I am usng R script (SOQL) as a data source in power BI.
When I try to run the script which is given below ,it is throwing an error
start_time <- Sys.time()
library(salesforcer)
library(dplyr, warn.conflicts = FALSE)
library(httpuv)
library(tidyverse)
library(readr)
library(odbc)
library(DBI)
library(dplyr)
library(stringr)
library(tidyr)
library(tidytext)
library(textdata)
library(tm)
library(purrr)
library(tibble)
library(openxlsx)
library(taskscheduleR)
#sf_auth()
username <- "nmurphy@analytics.demo" # normal email/sflogin
password <- "YOUR_SF_PASSWORD+YOUR_TOKEN"
instanceURL <- "https://login.salesforce.com/"
# Account table count
# ---------------------------------------------------
SFDC_Account_Daily <- sf_query(soql = "SELECT COUNT (Id),
day_in_month(CreatedDate),
calendar_month(CreatedDate)
FROM Account
WHERE IsDeleted = False AND CreatedDate=THIS_MONTH
GROUP BY day_in_month(CreatedDate),
calendar_month(CreatedDate)")
# Drop the attributes Column
SFDC_Account_Daily <- within(SFDC_Account_Daily, rm(attributes.type))
# Rename columns to meaningful names
SFDC_Account_Daily <- SFDC_Account_Daily %>%
rename(
Count = expr0,
Date = expr1,
Month = expr2)
# ---------------------------------------------------
# Account table count end
# SD_Project table count
# ---------------------------------------------------
SFDC_SD_Project_Daily <- sf_query(soql = "SELECT COUNT (Id),
day_in_month(CreatedDate),
calendar_month(CreatedDate)
FROM pse__Proj__c
WHERE IsDeleted = False AND CreatedDate=THIS_MONTH
GROUP BY day_in_month(CreatedDate),
calendar_month(CreatedDate)")
# Drop the attributes Column
SFDC_SD_Project_Daily <- within(SFDC_SD_Project_Daily, rm(attributes.type))
# Rename columns to meaningful names
SFDC_SD_Project_Daily <- SFDC_SD_Project_Daily %>%
rename(
Count = expr0,
Date = expr1,
Month = expr2)
Error :
i think you are complicating this for yourself, one solution to this will be to use some tool like windsor.ai to get data from salesforce to power bi.
https://windsor.ai/microsoft-power-bi-salesforce-report-dashboard-template/
Thank you for your update .We wont be able to use external application to fetch the data.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 63 | |
| 37 | |
| 34 | |
| 22 |