Extracting Raw Data Using Excel Services REST API

I am trying to create a home page in SharePoint 2013 that shows quick stats based on an Excel workbook stored in a document library. Through my research I found that I could leverage the Excel Services REST API to pull the information I need from the workbook
via URIs and display it on a SharePoint page in a seamless manner.
The problem I am having is pulling the data I need as raw text.
For example, I can create a page in HTML that says "Our sales for the month grew by [X%]" and use an img src tag that points to
http://sample.com/_vti_bin/ExcelRest.aspx/Documents/workbook.xlsx/Model/Ranges('Sheet1!A1')?$format=image to show a picture of cell A1 which contains the data I want to show inline on my page.
I want a way to pull the data in cell A1 as raw text so that I can format it as part of the HTML page. I tried using
$format=html, but that just takes me to a separate page where the cell is formatted exactly as it is in the workbook.
Is there a way to do what I am trying to do? The more detailed your response can be, the better as I am fairly new to these features. And also, is there a way to perform calculations of cells in HTML? Thanks in advance.

Hi,
According to your description, you might want to extract text value from a specific cell in an Excel file using Excel Services REST API.
As there is no such predefined format can be used to return text value only, I would suggest you return the value as json format, then parse it and set to your HTML
tag using jQuery.
Here is a <p> tag with a script which can set the value of the <p> tag with the value gets from cell “A1”:
<p id="cell1">test</p>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
//replace the strings below with yours
var libName = "Shared Documents";
var fileName = "Book1.xlsx";
var rangeName = "A1";
$(function(){
var s = getCellValue(libName, fileName, rangeName);
$("#cell1").html(s);
function getCellValue (libName, fileName, rangeName)
var cell = "";
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_vti_bin/ExcelRest.aspx/"+libName+"/"+fileName+"/model/Ranges('"+rangeName+"')?$format=json",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
dataType: "json",
async: false,
success: function (data) {
console.log(data.rows[0][0].v);
cell = data.rows[0][0].v;
error: function (data) {
console.log(data);
return cell;
</script>
You can add it into your page via a Content Editor Web Part, it will take effect after the page loaded.
Here are two links about how to add code into page via Content Editor Web Part:
http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • How to read azure storage data using JAVA with REST API

    Hi,
    We have a cloud service in our lab. We have enabled diagnostics
    in cloud services. So WADPerformanceCounterTable was created in storage account. Now , We want to read the WADPerformanceTable using
    JAVA with REST API. Is there any way to collect these details. please give me any
    sample code to connect azure storage using table service REST API.
    Thanks & Regards
    Rathidevi

    Hi,
    Please have a look at this article:
    https://convective.wordpress.com/2010/08/18/examples-of-the-windows-azure-storage-services-rest-api/, it demonstrate how to use table service Rest API, it also give us the code, hope this helps. Of course, the
    MSDN article could also help us coding.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can we see dynamic data on charts using Excel Services

    hi all,
    i would like to know if there is any option in SharePoint 2013 for developing dynamic "responsive/interactive Charts"  with SQL server as data source. And the connection should be there online, i mean the charts should refresh data based on
    the SQL data all the time. 
    When i saw the feature of excel service, i could see only retrieving of data using data connection from sql and after adding that data to workbook, we can create responsive charts with required filters. However, i dint see option of data refresh from external
    source without opening the excel work book. 
    What i want is, once i added the chart using chart webpart, if any new data is added or modified in external data source i.e., like SQL in my case, the chart should automatically updated with new changes in the data.
    please let me know if my requirement can be fulfilled using OOB.
    thank you beforehand .
    Thanks & Regards Raj

    Hi ALL,
    Linda, I know you are only trying to help but when you answer questions where you don't know the answer you only mislead the user asking the question at best but every one else who reviews the post... we have been performing data refresh on page
    render and every 5 minutes by default since SharePoint 2007. We build Business Intelligence Dashboards and Score Cards using Live data with Excel Services, and features like PowerPivot, PowerView
    Data in a Microsoft Office Excel workbook that has been displayed in Excel Services can come from two different locations. The data may be stored directly in the workbook, or it may be stored in an external data source, such as in a database or
    in an Online Analytical Processing (OLAP) cube.
    If the data comes from an external data source, the workbook author or administrator has defined the connection information, often in an Office data connection (.odc) file, which describes how to locate, log in, query, and access the external data source.
    When you are connected to an external data source, you can perform a refresh operation to retrieve the updated data. Each time that you refresh data, you see the most recent version of the data, including any changes that were made to the data since it was
    last refreshed.
    Refresh all connections
    On the Excel Web Access toolbar, under the Update menu, click
    Refresh All Connections.
    Periodic refresh
    By using Office Excel 2007, the workbook author can specify that data automatically refreshes at a specified interval after the workbook is opened for each connection in the workbook. For example, an inventory database may be updated every hour, and so the
    workbook author has defined the workbook to automatically refresh every 60 minutes. For more information, see Microsoft Office Excel 2007 Help.
    A Web Part author can select or clear the Allow Excel Web Access Periodic Data Refresh property to enable or disable this periodic refresh operation, if the property has been defined by the workbook author. When the time interval elapses,
    by default, the following refresh alert prompt is displayed at the bottom of the Excel Web Access Web Part:
    Refresh data for <List of Connections>? (Now) (Always) (Don't ask me again)
    An Excel Web Access Web Part author can also set the Display Periodic Data Refresh Prompt property to control the behavior of the message that is displayed when Excel Services performs a periodic data refresh during a session:
    Always      means that the message is displayed with a prompt at each interval.
    Optionally      means that a user can choose to continue periodic refresh without displaying a message.
    Never      means that Excel Web Access performs a periodic refresh without displaying a message or prompt.
    For more information, see
    Excel Web Access Web Part custom properties.
    I have only listed a couple of the ways you can have Excel services update external data, this is not an exhaustive list
    Data Refresh with Excel Services Reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/refresh-external-data-in-excel-services-HA010105474.aspx
    http://office.microsoft.com/en-us/sharepoint-help/work-with-external-data-in-excel-services-sharepoint-server-HA102830785.aspx
    http://technet.microsoft.com/en-us/library/jj879294.aspx
    -Ivan

  • Cannot refresh data in Excel Services with SQL Azure databases

    I am using Excel Services on a SharePoint Online.
    I get my data from a SQL Azure. When i create my Excel repor with Excel 2013 pro I have no problem. So I upload my file on my Sharepoint and try to refresh data.
    Connexion : Power Query - RPT_Event_ByEventType 
    Erreur : Erreur sur site (OnPremise) : Sorry, the data source for this data connection isn't registered for Power BI. Ask your Power BI
    admin to register the data source in the Power BI admin center. 
    I do not understad why I get that error because my data source is on Azure why It told me "OnPremise" ?

    hi,
    >> this button of excel gets just address of web and have button for import it
         i test it by rest API project , but doesn't work, do you know how it is work?
    Do you mean that you don't know how to get the table? You may input the site address into the address box, and then click go button nearby, select the table you want to import into the Excel. Then click import button.That also works for  rest API,
    and your rest API should get the data that you want
    By the way, this is the forum for discussions about Excel develop(VBA ,customization), better to go to TechNet forum for Excel for Excel features question, so that you could get more professional help.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create different Graphs in SharePoint 2013 without using Excel service?

    Hi All,
    I want to create different graphs in SharePoint without using Excel Service.
    I do not want to create excel and then upload that to SharePoint.
    Any one knows how to do that? Isthere any option to do that?
    Thanks in Advance

    Hi Darsh,
    You can use
    SharePoint chart webpart to display charts. Or you can use any jQuery charting library and feed data using JSOM or REST. Ex. high charts:
    http://www.highcharts.com/products/highcharts
    http://office.microsoft.com/en-us/sharepoint-server-help/sharepoint-lists-vi-exciting-ways-to-display-your-list-data-RZ102425636.aspx?section=3
    Best Regards,
    Brij K

  • Determine Email of the person in the people field using JSOM or REST API

    Hi,I have to build below HTML dynamically. The source to build this is a sharepoint list that has a people field in it.Can I use JSOM or REST API to do this? if so, can anyone help with some examples?<a href='mailto:[email protected],[email protected]'>Write email</a>
    techie

    Hi,
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    var array=new Array();
    var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('CustomList')/items?$select=EmployeeId";
    // execute AJAX request
    $.ajax({
    url: requestUri,
    type: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" },
    success: function (data) {
    var dataResults = data.d.results;
    for(var i=0;i<dataResults.length;i++){
    if(dataResults[i].EmployeeId!=null){
    for(var j=0;j<dataResults[i].EmployeeId.results.length;j++){
    array.push(dataResults[i].EmployeeId.results[j]);
    //remove the duplicated id
    var employeeIds=$.unique(array);
    //get the employee email by user id
    var emails=getEmailsByIDs(employeeIds);
    //add to send mail div
    $("#SendMail").append("<a href='mailto:"+emails+"'>Send Email</a>");
    error: function () {
    //console.log("Failed to get details");
    function getEmailsByIDs(employeeIds){
    var emails=new Array();
    var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/siteusers?$select=Id,Email";
    // execute AJAX request
    $.ajax({
    url: requestUri,
    type: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" },
    async: false,
    success: function (data) {
    var dataResults=data.d.results;
    for(var i=0;i<dataResults.length;i++){
    for(var j=0;j<employeeIds.length;j++){
    if(dataResults[i].Id!=null&&dataResults[i].Id==employeeIds[j]&&dataResults[i].Email!=null){
    emails.push(dataResults[i].Email);
    error: function () {
    //console.log("Failed to get details");
    return emails;
    </script>
    <div id="SendMail">
    </div>
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Dennis Guo
    TechNet Community Support

  • What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API

    The question says it all:
    What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API.?
    In the User Profile -> Permissions there is only the option for "Full Control".

    Hi Nikolay,
    Thanks for posting your issue, you need to set permissions on User Profiles = Read. Kindly find the below mentioned URLs to get the code and more details on this.
    http://www.vrdmn.com/2013/02/sharepoint-2013-working-with-user.html
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    http://sharepoint.stackexchange.com/questions/61714/sharepoint-2013-call-the-rest-api-from-sharepoint-hosted-app
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/09/how-to-query-sharepoint-2013-using-rest-and-javascript.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Getting Error while accessing the data using odata service

    Hi All,
    Iam new to SAP FIORI. 
    Iam getting the below error while accessing the data using odata service.
    "Failed to load resource: the server responded with a status of 404 (Not found)"
    "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin "
    i have tried all the solutions like changing the url pattern "proxy/htttp".
    and disabled - security in chrome (Chrome is Updated version).
    i tried with IE still got the same problem.
    And installed all the required software in eclipse
    While installing GWPA plugin i got the following error.
    let me know if any one have idea.
    Thanks in advance.

    > Do you want to add and/or update the data in the already existing tables or do you want to replace the content completely?
    >
    > so in that way :
    > bot the options are fine what ever take less time.
    Sorry mate, but YOU have to know what you want here.
    I gave you an easy to follow set of steps.
    As you don't seam to mind the outcome, just might just use them...
    > I wanted to know weathe i can use the  loadercli for thie export import or not? if yes then is there any new steps to do before i do the export import?
    We had this discussion before...
    >
    > For that the easiest option would be just to drop the tables of SAPR3 and run the import again.
    >
    > For ease of use you could also just do:
    > - logon as superdba
    > - drop user SAPR3
    > - create user SAPR3 password SOMEPW not exclusive dba
    >
    > After these steps you can easily pump the data into the database again.
    >
    > So here in th above given steps , i am creating a new SAPR3 user and why it is not exclusive dba ?
    >  i already have that user SAPR3 can i use the same.
    Yes, you do have the SAPR3 user.
    But you don't seem to like to read documentation or learn about how the tools work or anything like that.
    Therefore I gave you s simple way to reach your goal.
    Of course it's possible to reuse the user.
    But then you would have to deal with already existing tables, already existing data etc.
    You don't seem to be able to do that. So, the easy steps might be better suited for your needs.
    regards,
    Lars

  • How to extract the data into Excel / PDF from SAP

    Hi,
    We have spool number of a report output.
    We want to extract the data into Excel / PDF from SAP directly...
    Plz guide...

    Hi ,
    Please check this [Thread|HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE;. Hope your problem will be solved.
    You can check [this also.|http://wiki.sdn.sap.com/wiki/display/sandbox/ToConvertSpoolDataintoPDFandExcelFormatandSenditinto+Mail]
    Thanks,
    Abhijit

  • How is the Raw data used in iPhoto. I currently shoot both jpeg and raw and import them both into iPhoto.

    How is the Raw data used in iPhoto? I currently shoot both jpeg and raw and import them both into iPhoto. What do I gain by collecting Raw data?
    Thanks

    You get more parameters for making adjustments to the image. This is not really an iPhoto question but more a general photography one. In rather simple terms here's how a digital camera works:
    You expose an image. A lot of data is gathered in by the sensor. But it's just a bug lump of data and not very useful in that form.
    In cameras that shoot jpeg that mass of data is interpreted/processed into an actual image, and the image is stored in a jpeg file. (that's a process broadly analogous to developing a film). The decisions that go into making that interpretation are all made by an engineer somewhere, back when the camera was developed.
    If you shoot Raw, then what you do is take that mass of data, and rather than working to the decisions made by that engineer, you develop the shot - you run the digital darkroom.
    Why would you do this? Take on all this extra work? Well one of three reasons: a: you think you can do a better job than that engineer. b: you just prefer the result you get when you develop yourself or c: you're a hopeless shooter and raw means you have more options to fix the mistakes you made in the camera. (That's why I do it.)
    Here endeth the two dollar tour. So, basically, if you're happy with what your camera produces in Jpeg then there's really no need to shoot Raw.
    There's no need at all to shoot Raw+Jpeg as iPhoto creates a jpeg preview when you import, so you're just wasting space.

  • How to watch forum using Webcenter Discussions REST API

    If I am building an application using WebCenter Discussions REST API, what API should I invoke to watch forum, topic? If it is not available in the REST API, what is the workaround to do the same ?
    Did not find relevant information in the [http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_jive.htm#CHDGJECD] .

    Hi.
    REST Discussions API allow you to get all information that you need. It provides URL to Forums, topics... Or directly you can access to the messages.
    In addition, you can use REST Search API to search into discussion forums if you have Oracle SES.
    Off doc about information that can you get through REST API: http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_jive.htm#CHDGJECD
    In the case of that you need more information about provided by REST API or WebCenter API then you can implement your own ADF BC to consume Discussions schema :).
    Regards.
    Edited by: Daniel Merchán on 16-oct-2012 15:16

  • How to import the JSON data that comes from REST API into Excel 2013?

    HI,
    Is there a way to import the JSON data that REST API returns into Excel 2013? If so how?
    Could you please let me know this?
    If you need to know any more info please let me know.
    Thanks,
    Vinay

    I got this. We need to use power query add in for this.
    EXCEL 2013 -> POWER QUERY -> From Web
    Enter the URL for the REST end point and click ok. Power Query editor will show up with the URL and list of your data.
    click on the list -> Right click->drill down
    You will see the no of records the API returned.
    Right Click on List in that table -> To Table and say ok in the next dialog.
    On the displayed columns, there will be a double sided arrow, click on that and select the rows you want to import.
    There you go. You will all the data.
    Click on Apply and close. This will import the data into your excel file.

  • Problem while refreshing the data for the second time using excel services in sharepoint 2013...

    Hi,
    I have migrated my Sharepoint from 2010 to 2013.I am able to get the data at the first time of refresh when I click on refresh for the second time I am getting the empty the sheet.
    below find the flow of refresh
    First Refresh
    On Click of refresh open the workbook with excel services and return the session id.
    Using that session I am invoking RefrehAsync method of excel services
    After refresh completed I am setting the calculation of workbook as automatic(to calculate the formulas) using the same session id
    After setting the calculation as Automatic I am setting the calculation type as full(recalculate) using the same session id.
    Now I am able to see the data
    Second Refresh
    After clicking on refresh instead of opening the workbook I am using the session id(already opened workbook) and setting the calculation type as manual
    I am following the same process from refresh(RefreshAsync) as I have followed in first refresh.
    This time my formulas are not getting calculated because of that I am not able to see the data.
    Could you please let me know that am I missing anything here?
    Is this know issue in Sharepoint2013 excel services as same code is working fine with Sharepoint2010.
    If I close the workbook(session id null) and opens(new session id) for all the refreshes it is working and I am able to see the data.
    Thanks,
    Meenakshi Nagpal
    N.Meenakshi

    I am able to see the data for the second refresh  if I change the data source.If I use the same data source which is used in the first refresh I am not getting the data.Excel services will contact the cubes and calculate the formulas in my workbook.
    Could you please let me know what could be the problem at second refresh while contacting the same data source with same session id?
    Please help me asap.
    Thanks,
    Meenakshi Nagpal
    N.Meenakshi

  • Performance issue during SharePoint list data bind to html table using Ajax call(Rest API)

    Hello,
    I am having multiple lists in my SharePoint Site. I am using SharePoint REST APIs to get data from these lists and bind a HTML Table. Suppose, I have 5 lists with 1000 records each, I am looping 5000 times to bind each row(record) to this html table. This
    is causing performance issue which is taking a very long time to bind. 
    Is there any way So that I can reduce this looping OR is there any better approach to improve the performance. Please kindly Suggest.  Thank you for your help :)
    Warm Regards,
    Ratan Kumar Racha

    Hi Racha,
    For handling large data binding in a page,
    AngularJS would be a great option if you might would worry about the performance.
    You can get more information about using AngularJS from the two links below:
    https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications
    http://www.sitepoint.com/10-reasons-use-angularjs/
    Best regards
    Patrick Liang
    TechNet Community Support

  • Sending attachments/binary data from flex to Restful APIs

    Hi,
    We have a requirement of sending the files (or binary data) from flex GUI to Restful services(backend APIs). We are using flex HTTPService component to invoke the rest apis. The Rest APIs are designed to accept the multipart/mixed data which can support the binary data as well.
    Can any one help us understand, how can we send the multipart/mixed OR multipart/form-data  from flex to backend using the HTTPService. Or is there a better way to send the mixed data from Flex GU to Restful APIs.
    Request you to please respond to this at the earliest as this is very urgent.
    Thanks and Regards,
    --Revanth

    Has anyone worked on this issue?? i wanted a quick response as we are in the middle of the development and this is a r
    equirement
    Thanks
    -Revanth

Maybe you are looking for