Generic URLs in API Calls

How I can set generic URLs to use in more then one API Calls to change in just one point ?

Set a variable in Globals. That should become available in all server actions.

Variable = set value

Where I can do this ?In global.json file ?

On the server connect panel on the right.
Click Globals at the top, then add step there.
Once done, save it.

Then in the actual API/Server Action where you have the API step, in URL part… Click data picker icon and you should see the set value variable set in Globals.

Thanks a lot for the help…

I didn’t find the place to insert a variable

global

Sorry for the post deletes I just wanted to make sure my answer was right as sids answer saying on the right threw me of my panel is on the left maybe that’s a setting or something I just got confused lol looks like I was in the right area ill just link you the docs though as screenshots are easier to follow

Typo. :sweat_smile:

When you have clicked Globals, you should see options in the panel below - input, steps etc. Add a step there.
Or, just take a look at the doc link shared above.

Hello, You can see in the image an attachment that does not open an option according to the help.

What is the server model you are using?
And what os the Wappler version?

Also, could you try to create a new Wappler project and see if it works there?

After I started new project I can see the option, but it does not work. What am I doing wrong?

What are you trying to achieve here?

image

What do you want to store in host_rest?

My generic url is 161.148.157.57:8021

Im create a variable url in $_server

How I can set value to url to use in all difetent calls REST ?

Ok. It seems you don't have your basics right.
$_SERVER variables are meant to be read only and in the Value action you are storing a boolean as per expression.

You need to go through the learning materials.

https://docsdev.wappler.io

Additionally you could take the Getting Started course:

Thanks, Can I define global static variables?

You mean a constant or a variable that is available globally for all your app at any point?

In nodejs you can use dotenv module and add it there. Then you can read it from the $_ENV variables.

Thanks a lot!

To solve I did

1)I created an .env file with :
REST_HOST=IP address
REST_PORT=IP Port

2)I included in global $_env and step as show in image1.

3)I included in the call to variable in API action in image2.

image2