none
Table Headers Not Being Read with GetDataAsync RRS feed

  • Question

  • I have a sidepane app in MS Excel and I'm trying to use GetDataAsync to read a table binding. I need to get the first row, which is a row of headers. In the documentation:

    http://msdn.microsoft.com/en-us/library/office/fp161073%28v=office.1501401%29.aspx

    It says that I need to specify a coercionType: 'matrix' to read the first row. But when I do that I get an error saying that that coercion type isn't compatible with my binding.

    When I use coercionType: 'table',  the data in the retrieved array starts with row 2, or the first row of content. How can I read the table headers?

    • Edited by Andy Mercer Wednesday, December 17, 2014 9:22 PM
    Wednesday, December 17, 2014 9:14 PM

Answers

  • I ended up figuring it out, but the documentation could use a some work because it's really obscure. To get the table headers, you need to use: .headers instead of .rows, of the data object returned.
    • Marked as answer by Andy Mercer Thursday, December 18, 2014 3:12 PM
    Thursday, December 18, 2014 3:12 PM

All replies

  • Hi Andy,

    According to your description, the issue is more related to what the worksheet looks like.

    Is the binding object a table in current worksheet?

    It might be like this:


    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.

    Thursday, December 18, 2014 1:57 AM
    Moderator
  • I ended up figuring it out, but the documentation could use a some work because it's really obscure. To get the table headers, you need to use: .headers instead of .rows, of the data object returned.
    • Marked as answer by Andy Mercer Thursday, December 18, 2014 3:12 PM
    Thursday, December 18, 2014 3:12 PM