Forum Discussion
Cannot Apply operator Text and List Conversion required? or syntax error with Parameter usages
- 8 years ago
Your formula is passing a static string:
Json.Document(Web.Contents("URIPath&/Contact/Supplier/?api-version=v2"))and I believe that you're going after something like:
Json.Document(Web.Contents(Text.From(URIPath)&"/Contact/Supplier/?api-version=v2"))
Hi THEG72,
In your scenario, what will Web.Contents() return without Json.Document?
Web.Contents("http://localhost:8080/AccountRight/" & SelectCompany & "/Contact/Supplier/?api-version=v2")Thanks,
Xi Jin.
- THEG728 years agoHelper V
It returns the object, then you right click it and return the output to a Json format to get the original code shown below.
= Json.Document(Web.Contents(DataLocation & SelectCompanyURI & "/Contact/Supplier/?api-version=v2"))
I have the following Parameters defined:
DataLocation "http://localhost:8080/AccountRight/" (Text Based List of Values Manually entered)
SelectCompanyURI "d2c78098-1f9c-4334-aee9-27349b3ed6a4'" (Text Based List of Values manually entered)
The Datalocation api endpoint return the path required for each company file resource when you initially browse the list, convert it to a table and you can see the path required for the Web Contents code.
If i select the path and either Drill Down or Add as A query, how can i add this to the web.contents code line? I think I am missing some quotes maybe?
The code below returns an error, I assume i have the syntax incorrectDataFormat.Error: Invalid URI: The hostname could not be parsed. Details: URIPath&/Contact/Supplier/?api-version=v2,
Json.Document(Web.Contents("URIPath&/Contact/Supplier/?api-version=v2"))This line does work
http://localhost:8080/AccountRight/d2c78098-1f9c-4334-aee9-27349b3ed6a4/Contact/Supplier/?api-version=v2
URI Path http://localhost:8080/AccountRight/d2c78098-1f9c-4334-aee9-27349b3ed6a4
Thanks
- miguel8 years agoCommunity Admin
Your formula is passing a static string:
Json.Document(Web.Contents("URIPath&/Contact/Supplier/?api-version=v2"))and I believe that you're going after something like:
Json.Document(Web.Contents(Text.From(URIPath)&"/Contact/Supplier/?api-version=v2"))
- Anonymous8 years agoNot applicable
M language - Web.Content error : &
Hello,
It’s been 2 days I’m blocked, I can’t find the answers à forums.
My formula M langage is Web.Contents(« http://...&... »&[IDMaster]& « ....&... ») as Binary
This gives me an error message : Operator=& and replaces the url ...&... to ...&....
My goal is to view the images from that Dynamic URL using power query, power pivot and then power view.
It work with static url but not with a dynamic one
I’ve tried to add Text.From but I get the same error
Thank you in advance for you help
Claire