Skip to main content
adem_netsys
Explorer III
Aug 25, 2023 11:12 AM UTC
Solved

Playbook Variable

Hi guys,

 

How can I use the set variable value in a playbook I created in a different playbook?

    dspille
    dspilleAnswer
    Staff
    Aug 25, 2023 2:19 PM UTC

    Hello Adem_netsys,

     

    The most common way this is done is by adding a parameter to your referenced (child ) playbook via Tools > Parameters.  Then you are able to pass specific variables to that playbook

     

    parameter.PNG

     
     

    When you call the child/reference playbook from the parent playbook, you are able to insert variables into the new parameter

    parent_variable.PNG

    call_reference.PNG

     

    Then back in the child playbook you can use the parameter using parameter.PNG

     

    When we run the playbook we can confirm that the variable was passed.

     

    playbook_execution.PNG

     

    I've attached this playbook to my comment so feel free to give it a try. Hope this helps!

    10 replies

    Esteemed Contributor III
    Aug 25, 2023 12:38 PM UTC

    Thanks for reaching out, please help share some more info, so that we can facilitate your ask.

     

    Translate
    adem_netsys
    Explorer III
    Aug 25, 2023 12:41 PM UTC

    I have one playbook and it has a set variable value in it. I want to use this variable value in different playbooks.

    Translate
    swolf
    Staff
    Staff
    Aug 25, 2023 12:48 PM UTC

    I think you need to expand on the use case. i.e. What's the use case for the playbooks? Why do you need to pass that data stored in the variable into another playbook? 

    To my knowledge, the only way that you could use that variable's value in another playbook, is if that playbook then calls another playbook (via referencing), and passes that variable into the referenced playbook.

    An alternative is it to pass the value of that variable into a global variable, or to store the data in a custom module, but I probably wouldn't recommend those without knowing the use case.

    Translate
    Esteemed Contributor III
    Aug 25, 2023 12:52 PM UTC

    Thank you so much @swolf and @adem_netsys for your prompt reply. 

    In addition, please see Playbooks Guide https://docs.fortinet.com/document/fortisoar/7.4.1/playbooks-guide/331279/introduction-to-playbooks#Introduction_to_Playbooks


    Feel free to add on more details and our experts will pitch in.

     

    Translate
    dspille
    Staff
    dspilleAnswer
    Staff
    Aug 25, 2023 2:19 PM UTC

    Hello Adem_netsys,

     

    The most common way this is done is by adding a parameter to your referenced (child ) playbook via Tools > Parameters.  Then you are able to pass specific variables to that playbook

     

    parameter.PNG

     
     

    When you call the child/reference playbook from the parent playbook, you are able to insert variables into the new parameter

    parent_variable.PNG

    call_reference.PNG

     

    Then back in the child playbook you can use the parameter using parameter.PNG

     

    When we run the playbook we can confirm that the variable was passed.

     

    playbook_execution.PNG

     

    I've attached this playbook to my comment so feel free to give it a try. Hope this helps!

    Translate
    adem_netsys
    Explorer III
    Aug 26, 2023 9:49 AM UTC

    Hi Dylan,

     

    First of all, thank you very much for your concern. What is the difference between creating a global variable and giving a parameter?

    Translate
    sjinturkar_FTNT
    Staff
    Staff
    Aug 29, 2023 9:25 AM UTC

    As name suggests Global Variable is global at FortiSOAR instance and it will be accessible and used by any playbook in the instance. Whereas parameter is local to that specific PB instance. 

    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024