cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aimane75
Frequent Visitor

Dynamic tabels from API

Hello,

 

 

 

shared Helloworld.Contents = (optional message as text) =>
    let
        endpoint = "My link to the API",
        directive= "A",
        cache    = "false",
        headers  = Record.FromList({"Headers"}),
        payload  = Json.Document(Web.Contents(endpoint, headers)),
    value = payload[value],
    #"Converted to Table" = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", headers)
    in
        #"Expanded Column1"; 

 

 

When compile this, I get this error:

 

1 Arguments were passed to a function which expects 2. What can it be?

 

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @aimane75 ;

May be the error come from Record.FromList

vyalanwumsft_1-1634865901067.png

For example ,

= Record.FromList({1, 2}, {"a", "b"})

https://social.technet.microsoft.com/Forums/office/en-US/1fd26cde-2d33-4f36-974e-e5c74b9f0c37/record...

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @aimane75 ;

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @aimane75 ;

May be the error come from Record.FromList

vyalanwumsft_1-1634865901067.png

For example ,

= Record.FromList({1, 2}, {"a", "b"})

https://social.technet.microsoft.com/Forums/office/en-US/1fd26cde-2d33-4f36-974e-e5c74b9f0c37/record...

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@aimane75 , Is it showing the option to click here to see an error?

Any function with one argument is under doubt as of now

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

No, it doesn't show which function specifically has an error:(

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!