Power Query - M language Questions RRS feed

  • Question


    Hi,  Wer have pulled data from a restful api and that give us the session information, we are then wanting to use that information to pull more infromation out.


    My question is how would you reference and array within M and have two 'LETS'... see below for code.


         apiUrl = "",
         data ="{'sessions':[{'username':'**', 'password': '**'}]}",
         options = [
                      Headers =[#"Content-Type"="application/json", #"X-Api-Key"="*****"],
                      Content = Text.ToBinary(data)
         Value = Web.Contents(apiUrl,options),
        #"Imported JSON" = Json.Document(Value,65001),
        sessions = #"Imported JSON"[sessions],
        sessions1 = sessions{0}
        apiUrl = "",
         options = [
                      Headers =[#"Content-Type"="application/json", #"X-Api-Key"="*****", #"Authorization"=sessions1.access_token, #"X-Organization-Id"=sessions1.organizationid]
         Value = Web.Contents(apiUrl,options)

    So im also wanting to know how to access the 'access_token' and 'organizationid' in the sessions1 array.



    • Edited by JaK82 Wednesday, April 12, 2017 8:11 AM
    Wednesday, April 12, 2017 8:11 AM

All replies

  • Hi JaK82,

    Thanks for visiting our forum.

    Then this forum mainly focus on general questions and feedback about Excel client. As per your specific query about Power Query and M language, it is suggested to post to the following dedicated Power Query forum for better response:

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Your understanding is highly appreciated.

    Best regards,
    Yuki Sun

    Please remember to mark the replies as answers if they helped.

    If you have feedback for TechNet Subscriber Support, contact

    Thursday, April 13, 2017 2:38 AM