Web request with variable in the url


#1

1) Give a description of the problem
I want to make a web request and use defined variable inside the url

2) What is the expected behaviour?
return something

3) What is happening/not happening?
it return nothing, when I use “text” it works but @variable not working

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Before you make the web request, try logging the URL to console first to see if it’s being put together how you’re expecting it.


#3

Thanks for reply! How can I do it? I do not see anything in my log about the url…


#4

Instead of Make Web Request, select the “Log to console” task.


#5

when I put the expression inside a variable…it gives : 0
So I presume that its not working as expected…


#6

0 again
in the webrequest, I use the ‘expression’ option, is there another way of doing it?


#7

Put that expression in the Log to console task and look at the output.


#8

0 always


#9

I m able to get the first variable but the second one still shown as text… like:
http/[email protected]
It should have a transition between …maybe a formula to merge text? concatenate?


#10

In an expression box, you can concat using the + sign


#11

You need to put your variables inside {@curly_brackets} when typing the URL.


#12

I make it works this way:
https://api.openweathermap.org/data/2.5/onecall?lat=@actual_latitude + “&lon=”@actual_longitude “&units=metric&exclude=hourly,daily,minutely&lang=fr&appid=xxxxxxxxxx”

Looks like I was using & at the place of + and I also notice that the + is not even needed after a variable, it miss one and still working…

Thanks again! You found it!


#13

Glad you got it working.

If you just type the URL as a ‘value’ rather than an ‘expression’, using {@curly_brackets} for your variables, you would save yourself the whole “…”[email protected]+"…"[email protected] mess

:wink: