Call a particle function passing an argument (toggle switch)

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

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?


Hi @JuliaKempf

Thanks for coming on my rescue!

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

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. 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,

Thanks Julia!

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

1 Like