Forum Discussion

dvdbroek's avatar
dvdbroek
Frequent Visitor
5 years ago
Solved

Using the given variable parameters and putting them in a JSON format body in M

Dear PowerBI wizzards,   Im pretty new to M and its coding. Currently im working to make a presentation with its input comes from an API. The API itselfs needs to be provided with a ClientIdentifie...
  • dvdbroek's avatar
    5 years ago

    I came up with this and it works:

     

     body = "{""clientIdentifier"":""xxxxxxxx"",
            ""clientSecret"":""xxxxxxxx"",
            ""username"":" & Text.FromBinary(Json.FromValue(UserName)) & "," & "
            ""password"":" & Text.FromBinary(Json.FromValue(Password)) & "," & "
            ""officeCode"":" & Text.FromBinary(Json.FromValue(OfficeCode)) & "}",

     

    If there are smarter or better solutions i gladly hear them:)