Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tross4012
Helper I
Helper I

Multiple local variables in API Call

I am trying to make a call to an API with variables "offset" and "limit". However, I think I am running into issues with my syntax. See the picture below:

 

tross4012_0-1650467920307.png

My problems seems to stem from the bolded/underline text:

 

Source = Csv.Document(Web.Contents("https://ClinicalTrials.gov/api/query/study_fields?&fields=NCTId,LeadSponsorName,Phase,BriefTitle,Org...max_rnk=" & Number.ToText( limit )"&fmt=csv&min_rnk=" & Number.ToText( offset )),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),

 

Does anyone see any issues with the syntax of my function here? I can make use of my "offset" variable but not "limit". Does it have something to do with my placement of quotation marks? Please let me know if further information is required to answer this question. Thanks a ton!

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

Hi, @tross4012 

 

& is used to concatenate strings, so if there is no & in "", it should be placed outside "".

vjaneygmsft_0-1650855166293.png

But I don't know what the specific form of the line is, so you need to modify it according to my attempt and your actual situation.

Try like this:

vjaneygmsft_1-1650856694401.png

 

Best Regards,
Community Support Team _ Janey
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

1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @tross4012 

 

& is used to concatenate strings, so if there is no & in "", it should be placed outside "".

vjaneygmsft_0-1650855166293.png

But I don't know what the specific form of the line is, so you need to modify it according to my attempt and your actual situation.

Try like this:

vjaneygmsft_1-1650856694401.png

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.