locked
REST API returns null RRS feed

  • Question

  • The code reads the REST API, but returns null in each cell??

    The code is:

    let

        cfaURL = url
        cfatoken = token,

        SourceContent = Json.Document(Web.Contents(cfaURL & Text.From(cfatoken))),
        data = SourceContent[fields],
        #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        #"CFA Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"objectid", "cfa_id", "farm_holding_name", "land_owner", "tenant_leasehold_occupier", "globalid", "Shape__Area", "Shape__Length", "geometryField"})
        in
     #"CFA Column1"

    The query returns the column names, but all the cells are empty??


    I would appreciate any assistance.

    Regards,

    Clive


    Clive

    Sunday, November 1, 2020 5:27 PM

Answers

  • Hi Clive. What do you get if you just evaluate the following?

    Text.FromBinary(Web.Contents(cfaURL & Text.From(cfatoken)))

    Ehren

    Wednesday, November 4, 2020 7:23 PM

All replies

  • Hi Clive,

    your conclusion might not be correct. The column expansion would also happen if your api returned nothing.

    Therefore I'd suggest that you delete the last step of the query and expand the columns manually again. Then you should be able to see what's actually been returned.


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Sunday, November 1, 2020 6:01 PM
  • https://happycoding.io/tutorials/java-server/rest-api

    hassansayedissa

    Sunday, November 1, 2020 6:18 PM
  • Thanks for the suggestion.

    I don't understand why it doesn't bring back the data, that is what I am trying to get working.

    Regards,

    Clive


    Clive

    Monday, November 2, 2020 12:38 AM
  • Hi Clive. What do you get if you just evaluate the following?

    Text.FromBinary(Web.Contents(cfaURL & Text.From(cfatoken)))

    Ehren

    Wednesday, November 4, 2020 7:23 PM