Forum Discussion

krishn's avatar
krishn
Icon for Helper I rankHelper I
2 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    2 years ago

    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')



    2. Use the variable in Copy Activity


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



  • Anonymous's avatar
    Anonymous
    2 years ago

    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 .

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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')



    2. Use the variable in Copy Activity


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



    • Anonymous's avatar
      Anonymous
      Not applicable

      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 .

      • krishn's avatar
        krishn
        Icon for Helper I rankHelper I

        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. 

    • garcondeua's avatar
      garcondeua
      New Member

      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?