The output of get record activity in salesforce is in ‘report’ variable type . this can’t be written to excel
Hi @Rohit_Nair
Start by using the Salesforce Application Scope to connect to Salesforce. Then, use the Get Record activity to fetch the report, storing it in a variable. Since the report may not be in a DataTable format, you might need to extract the relevant data by looping through the report or using a query to retrieve the data as a DataTable. Finally, use the Excel Application Scope and the Write Range activity to write the DataTable to an Excel file.
If you found helpful, mark as a solution . Thanks
hi @Rohit_Nair Welcome to the community!
You can debug you project set up a breakpoint after the get record and in the immediate panel spy the variable properties. If there is a datatable in the property of the var you can use that to write or if there is something like report.record you can collect those in a dt and write it to an excel
I cannot use the salesforce app scope , as it requires username & password . Due certain security concerns that won’t be provisioned .
Instead im trying to test it with my account connection to salesforce activity by logging in one time .
report { allData=true, attributes_describeUrl=null, attributes_instancesUrl=null, attributes_reportId=null, attributes_reportName=null, attributes_type=null, CreatedById=null, CreatedDate=null, Description=null, DeveloperName=null, FolderName=null, Format=null, groupingsAcross_groupings=null, groupingsDown_groupings=null, hasDetailRows=true, Id=null, IsDeleted=null, LastModifiedById=null, LastModifiedDate=null, LastReferencedDate=null, LastRunDate=null, LastViewedDate=null, Name=null, NamespacePrefix=null, OwnerId=null, reportMetadata_aggregates___=null, reportMetadata_chart_chartType=null, reportMetadata_chart_groupings___=null, reportMetadata_chart_hasLegend=null, reportMetadata_chart_showChartValues=null, reportMetadata_chart_summaries___=null, reportMetadata_chart_summaryAxisLocations___=null, reportMetadata_chart_title=null, reportMetadata_detailColumns___=null, reportMetadata_developerName=null, reportMetadata_folderId=null, reportMetadata_groupingsAcross=null, reportMetadata_hasDetailRows=null, reportMetadata_hasRecordCount=null, reportMetadata_historicalSnapshotDates=null, reportMetadata_id=null, reportMetadata_name=null, reportMetadata_reportFilters=null, reportMetadata_reportFormat=null, reportMetadata_reportType_label=null, reportMetadata_reportType_type=null, reportMetadata_scope=null, reportMetadata_showGrandTotal=null, reportMetadata_showSubtotals=null, reportMetadata_sortBy=null, reportMetadata_standardDateFilter_column=null, reportMetadata_standardDateFilter_durationValue=null, reportMetadata_standardDateFilter_endDate=null, reportMetadata_standardDateFilter_startDate=null, reportMetadata_standardFilters____name=null, reportMetadata_standardFilters____value=null, SystemModstamp=null }
the above is the output of get record activity
is this the true output or have you sanitized it since all of your fields are null. if you havent then you might need to check your permissions.
Once you get data you can experiment with the metadata fields. Also, see if you can replicate your report filters using soql and try executing that
If it is json format, here you can achieve this process in different ways,
- try convert it string, after that use deserialize activity after that based on keys extract data and by using build data table activity create a new datatable and try to add all these values to datatable
- after converting to string you can follow below video to convert the data from json to datatable
https://www.youtube.com/watch?v=A3oBcGTMng8
I did not sanitize it , probably would have to check the report permissions .
what activity would execute the soql ?
The challenge is that the output of get record activity is in ‘report’ variable type & json .
Can you share screenshot of that variable and type. and activity along with properties
