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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
krishn
Helper I
Helper I

Parametarized relative URL in Microsoft Fabric

Hi, We are very new to Microsoft Fabric. I am trying to create copy activity using REST API linked service. We have to connect to API URL and run daily job supplying Yesterdays date and other parameter values. Manually we were able to pull data (adding parameter values in relative URL) but we need to pass the date values dynamically so we can schedule the job.

Example base URL : https//:api.indigo.com

Relative URL : /z1/ktdata/sale/data/?expd=FALSE&pdt='yesterday date'&offset=0&lmt=10000

where we wanted to pass expd, pdt, lmt values dynamically; especially the pdt which is previous day date in yyyy-mm-dd format.

Any help appreciated.

2 ACCEPTED SOLUTIONS
v-gchenna-msft
Community Support
Community Support

Hi @krishn ,

Thanks for using Fabric Community.
Below steps will help you set previous date dynamically.

1. Add Set Variable with below expression -

@addDays(utcnow(), -1,'yyyy-MM-dd')

vgchennamsft_1-1710482371973.png



2. Use the variable in Copy Activity

vgchennamsft_0-1710482311833.png


Hope this is helpful. Please let me know incase of further queries.



View solution in original post

Hi @krishn ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
Otherwise, will respond back with the more details and we will try to help .

View solution in original post

4 REPLIES 4
v-gchenna-msft
Community Support
Community Support

Hi @krishn ,

Thanks for using Fabric Community.
Below steps will help you set previous date dynamically.

1. Add Set Variable with below expression -

@addDays(utcnow(), -1,'yyyy-MM-dd')

vgchennamsft_1-1710482371973.png



2. Use the variable in Copy Activity

vgchennamsft_0-1710482311833.png


Hope this is helpful. Please let me know incase of further queries.



Hi,

I have a bit different question regarind parameterized values in the Relative URL box. I need to pass a value that I'm storing in the Set Variable activity, and need to use it in my relative path address. For example, I'm trying to do the following:

/vehicles/GetModelsForMakeId/@variables('makeIdInt')?format=json

However, it comes back with the following error:  

ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 404 NotFound, please check your activity settings.
Request URL: https://vpic.nhtsa.dot.gov/vehicles/GetModelsForMakeId/=@variables('makeIdInt')?format=json.
Response: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.,Source=Microsoft.DataTransfer.ClientLibrary,'

Where you can see that the get request did not use my parameter value. Any ideas?

Hi @krishn ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
Otherwise, will respond back with the more details and we will try to help .

Hi Not sure how I missed it, I am happy to accept the solution, I followed the steps with minor changes and successful. Appreciate for help. 

Helpful resources

Announcements
FabricCarousel_June2024

Fabric Monthly Update - June 2024

Check out the June 2024 Fabric update to learn about new features.