I have a Copy Data task which is obtaining data from an API
The API is a GET call to a method and requires 2 parameters
_token
Symbols
I have defined these as parameters
What is the syntax that allows me to use the values of my parameters as the values that are in the query string? So in the screenshot above Symbols is hard coded, but I want the value to be the value of the parameters
I need a screen solution rather than code please as I am not comfortable with ADF yet and I dont know how to get to the code/ARM views
Paul
Using a feature called string interpolation where expressions are wrapped in #{ ... }
Click on the Base URL field. Add Parameters. Using Concat expression function,
Example:
#{Concat('https://stackoverflow.com/questions/GetRealTimeRates?',linkedService().Symbols,'=',linkedService()._token)}
Add first parameter:
Add second parameter:
Test connection. If you see any error, it would provide a description as to debug further.
Related
I'm using ADF Web activity to submit a GET request to the external API.
From the web activity (2) I'm getting the following output:
Now, I want to assign a variable with value of the element that is marked on the screen.
Unfortunately, the following expressioin is invalid:
#activity('Web1').output.ADFWebActivityResponseHeaders.Total-Count
Is looks to me that ADF is not able to parse this expression due to special character ("-") in the name of property I'm trying to extract.
When I use a different expression to access a different parameter:
#activity('Web1').output.ADFWebActivityResponseHeaders.Status
it works.
Do you have any idea how I should write the expression to extract the value of "Total-Count" ?
According to this post ADF retrieves value from field with dash from json file this could work for you, too.
The expression in your case could look like this:
#activity('Web1').output.ADFWebActivityResponseHeaders['total-count']
I've been trying to set the value of a parameter, based on the value I set of another parameter. This wasn't working but then I discovered the Parameters with Functions JSON example on the Azure GitHub
This is giving the same behaviour as my own template so is perfect to show the issues I am having.
As you can see from the JSON linked to above, the parameter hostingPlanName should concat the parameter siteName with the string -plan. When I edit the parameter file, I see the function instead of the value it resolves to.
This example pulls other values in to set the value of siteName, I wondered if that was the reasons so hard set siteName to 'TEST' and the result for hostingPlanName was the same.
I haven't deployed this example, but if I deploy my real template, it throws an error with Bad Request for the name of the resource I am deploying.
Is this me or is this not possible anymore?
I am using VS2019 Community.
This is a great place to use variables. Your hostingPlanName is not set directly by user input (as parameters should be), but is a dynamic evaluation of a complex value based on a parameter, so it should be a variable.
What's the difference between using : and ? in a URL? For example /products/:id and /products?id=1? I am trying to get the values from the URL like this Product.findById (req.params.id) but I was wondering which one is most suitable. I know using : do I have to use req.params and ? req.query but I don't understand the difference between them, are they the same?
in my point of view, it is totally different if you are using RESTFUL API pattern
/products/:id called path parameters
The path parameters determine the resource you’re requesting for. Think of it like an automatic answering machine that asks you to press 1 for service, press 2 for another service, 3 for yet another service and so on.
Path parameters are part of the endpoint itself and are not optional
but query parameters
Technically, query parameters are not part of the REST architecture, and they used to help you completely understand how to read and use API’s Query parameters give you the option to modify your request with key-value pairs.
Having your parameters in the query is conceptually optional to the router, query parameters are more of properties and descriptions of the request itself, like when saying GET /users?sort=asc, in this case, the sort attribute was more of a description to the request and the request could complete the fetch without it, that might not always be the case, but a query parameter still describes its request even if it was mandatory.
On the other hand, URL parameters are part of the request itself, the URL without the parameter doesn't make sense, like GET /users/:userID, in this case, not supplying userID will supply unexpected data (A list of users for example) if it didn't break the router completely. URL parameters play part in defining the request rather than just describing it, and they can't be optional.
So...I managed to create a URL which populates a parameterised information link.
https://myserver-prod.mycompany.net/SpotfireWeb/ViewAnalysis.aspx?file=/Reports/02_Testing/Hyperlink_Parameter_Test&configurationBlock=pCountry%3D%22GERMANY%22%3B
This passes in GERMANY to the pCountry parameter and is working fine.
However, I am not sure how I would push in an array of values. I have changed my parameter to be an array, and am trying different things but they are not working.
This documentation isn't great in this respect.
https://community.tibco.com/wiki/create-configuration-block-tibco-spotfire
I have tried things like this, where I am comma separating the parameters (here I am passing in GERMANY and FRANCE separated by a url encoded comma (%3B).
https://spotfireweb-prod.rd.astrazeneca.net/SpotfireWeb/ViewAnalysis.aspx?file=/GMD/GRAPSQA/ARIEL/Reports/02_Testing/Hyperlink_Parameter_Test_Array&configurationBlock=pCountry%3D%22GERMANY%3BFRANCE%22%3B
A list parameter has the following syntax:
COUNTRY={"GERMANY","FRANCE"};
Used in a URL it must be encoded: COUNTRY%3D%7B%22GERMANY%22%2C%22FRANCE%22%7D
Learn more about configuration blocks here: https://community.tibco.com/wiki/create-configuration-block-tibco-spotfire
I'm writing an action method that will store a new object in a database. Once this is done, I want to navigate to view that newly created object. To do this, I was planning to include a querystring or some sort of parameter in the return String of the action method, but I can't figure out how. If I append a query string manually, it appears that it's being ignored. Also, manually adding parameters by concatenating strings doesn't seem like a good idea to me. Is it possible to do this in a type-safe manner?
The way I've always handled this is to get a reference to the bean which provides the content for the page you'll be displaying, and just set its properties directly. The navigation string returned from an action method isn't meant for passing parameters, but you don't need it to; all they'd be used for is setting bean properties anyway.