# Call a particle function passing an argument (toggle switch)

**URL:** https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820
**Category:** Help
**Tags:** particle, dashboard, workflow
**Created:** [April 12, 2020, 7:13pm UTC](https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820 "2020-04-12T19:13:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Felipe\_Cunha1](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@Felipe\_Cunha1](https://forums.losant.com/u/Felipe_Cunha1)
#### Post date: [April 12, 2020, 7:13pm UTC](https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820/1 "2020-04-12T19:13:23Z")

</div>

Hi guys,

I’m new to Losant and I have a very simple question.

I have a Particle photon connected to my Losant app. I’m trying to call a particle function passing as the argument the selection of a toggle switch via workflow (not command).

This is the payload on my ‘send command’ button (trigger workflow is selected):

{  
“manual”: {{toggle-0}}  
}

In my workflow I have a virtual button and a particle function blocks.

How do I pass “manual” as the argument to my function in my workflow?

Thank you

---

<div class="post-metadata">

### Author: ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)
#### Post date: [April 13, 2020, 2:04pm UTC](https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820/3 "2020-04-13T14:04:08Z")

</div>

Hi @Felipe_Cunha1,

To further assist me with this question, could you include a screenshot of your current workflow that is toggled by the button?

Thanks!  
Julia

---

<div class="post-metadata">

### Author: ![Felipe\_Cunha1](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@Felipe\_Cunha1](https://forums.losant.com/u/Felipe_Cunha1)
#### Post date: [April 13, 2020, 4:54pm UTC](https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820/5 "2020-04-13T16:54:27Z")

</div>

Hi @JuliaKempf

Thanks for coming on my rescue!

The button “Manual Mode” is the triggers my function. Please see print screen below

 ![print](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/2e242016f98339d6bf03be7ad9f0e27fb2ff053c.png)

---

<div class="post-metadata">

### Author: ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)
#### Post date: [April 13, 2020, 6:02pm UTC](https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820/7 "2020-04-13T18:02:51Z")

</div>

Hi @Felipe_Cunha1,

You can reference the value sent by your input control block by changing your Argument Method to a `payload path`.

The data from your dashboard button is visible within your [Debug Log](https://docs.losant.com/workflows/outputs/debug/#viewing-debug-output). In your debug log, `manual` should be accessible within the `data` object. Thus, if you set the Argument Payload Path to be `data`, you will include `“manual”: {{toggle-0}}` as your function argument.

Let me know if I can explain this further!

Thanks so much,  
Julia

---

<div class="post-metadata">

### Author: ![Felipe\_Cunha1](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@Felipe\_Cunha1](https://forums.losant.com/u/Felipe_Cunha1)
#### Post date: [April 13, 2020, 8:10pm UTC](https://forums.losant.com/t/call-a-particle-function-passing-an-argument-toggle-switch/2820/8 "2020-04-13T20:10:43Z")

</div>

Thanks Julia!

I was confused where exactly in the payload my argument would be. Its working like a charm now, thank you
