FortiSOAR Discussions
Dretzers
New Contributor

Global Variable in fortisoar

Hello,


I have a problem.


I want to use a global variable in a referenced playbook.
But this global variable is sometimes global.toto and sometimes global.tata
My idea is to use a variable for toto and tata and to call the correct global variable using global[var]
where var = toto or var = tata
I don't know how to call it, because I don't actually know how to make it work... Do you have any ideas on how to make this work?

 

Best regards,

4 REPLIES 4
anerot-forti
Staff
Staff

Hi,

 

did you try to use the "Parameter" to define a local playbook var that has to be transmitted when referencing your playbook in a parent one? In that way you can call your child playbook and assign the value toto/tata to your var easily.

Regards

Arnaud
Dretzers

Hello mister Nerot,

 

I tried, but in reality :
1. The parent playbook sends data to the child playbook.
2. Then the child playbook uses the tata to do something when it gives toto as a response => I want to retrieve this response and use it as a parameter afterwards with a while loop saying ‘if this parameter is not null then ... ’.

My problem is having this parameter updated by the child playbook and using it with the parent playbook. I actually use global.variable but I'd prefer to use something else because you can't have multiple global variables using calls like ‘global.vars.$var’ or ‘global.vars[$var]’ which is my main problem.

If you have any experience of this and can help, please do.


Best regards,

tkanade
Staff
Staff

Referenced child playbook's last step's data is send back to parent playbook. Save data that you want in last step of child playbook, you will see it in reference step in parent playbook

Dretzers

Hello,


Yes, I can store it and use it in another step, but do you have any ideas on how to use it in the same step? As I said, I'd like to use it in a ‘Reference a playbook’ step using do until. If you know how to do this, can you share a playbook or something that I can't use to understand what you're saying?