Skip to content

Set variable with script part #172

Answered by LindevdH
LindevdH asked this question in Q&A
Discussion options

You must be logged in to vote

@AnWeber Thanks for the reply/example.
I was able to test the solution today. My final script:

@ip = --.-.--.--
@port = ---1
@company = ***
@stable = 2
@flocknumber = 0

### GETBasics
# @name Basics
GET http://{{ip}}:{{port}}/basics/{{company}}/{{company}}-{{stable}}

### Get Medication
# @name medication
# @ref Basics

{{
    console.info(flocknumber, typeof flocknumber);
    if( flocknumber === "0") {
        exports.flocknumber = Basics[0].flockNumber;
    } 
}}
    
GET http://{{ip}}:{{port}}/medication/{{flocknumber}} 

This wil help me to setup manipulation scripts.
I will have to look for a way to clear the cache in order to work with changes without the need of opening and closing…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@LindevdH
Comment options

@AnWeber
Comment options

@AnWeber
Comment options

Comment options

You must be logged in to vote
1 reply
@LindevdH
Comment options

Answer selected by LindevdH
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants