# Particle call settings

**URL:** <https://forums.losant.com/t/particle-call-settings/1652>\
**Category:** Help\
**Tags:** workflow\
**Created:** [March 24, 2019, 4:29am UTC](https://forums.losant.com/t/particle-call-settings/1652 "2019-03-24T04:29:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tron7](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@Tron7](https://forums.losant.com/u/Tron7)\
**Post date:** [March 24, 2019, 4:29am UTC](https://forums.losant.com/t/particle-call-settings/1652/1 "2019-03-24T04:29:56Z")

</div>

Hi there !  
I’m using in my workflow a “particle call function” in order to send commands to a registered function in particle code.  
I verified that the function is operative using particle console.  
Apparently I am loosing the link to call it from the dashboard.  
I do not realize what I’m doing wrong with the particle call node in the workflow.

I just want to send the values RF1, RF2, RF3, RF4, RF5, RF6,RF7 as command arguments when the function get called .  
In order to do that I am using a drop-down selector called " SELECT" and a Button called " SET SELECTION"  
I am attaching the corresponding particle function and pics to show the settings.

Thank you in advance.

```auto
Particle.function("refSel",selection);

int selection (String command)

{
if(command =="RF1"){
ref=10;
}

 else if(command =="RF2"){
ref=20;
}

else if(command =="RF3"){
ref=30;
}

// And so on

else { Serial1.println(No data);}

Serial1.println("ref:");

Serial1.println(ref);

```

 ![Drop%20Down%20Selector](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/c948d87fa8fd494df6f2edf920dcca85911a946f.png)

 ![SET%20SELECTION](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/fbe21bda0dd14516591059d28c2dc83bcdbd3434.png)

 ![Main%20flow](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/c9cac2ab85840af78aa16c50d9902c744b3b66ee.png)

 ![Partial%20flow](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/5/5d4287408389e95789c5b76c35f9df8a3247f71d.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:** [March 25, 2019, 6:24pm UTC](https://forums.losant.com/t/particle-call-settings/1652/2 "2019-03-25T18:24:50Z")

</div>

Hello @Tron7!

I see a couple of possible problems and I will detail each so we can debug 😀

The first thing I see that could cause some problems is the configuration of your Input Control block. For `Set Selection` you have a space before label and a space inside of the quotes for Select-0, like so: `"_label": "{{ Select-0}}_"`. This will cause the value to have an extra whitespace character at the end, and look like this on the payload:  
 ![19%20PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d1d774d31d966df8c0014ce422bc9ad38388c9fb.png)  
This can cause some problems if you are doing conditionals, as `label="10"` will return `true`, but `label="10 "` will return false. The whitespace character could cause a problem with your Particle code as it would be coming through as "RF3 " instead of “RF3”, for example.

The second change you will need to make is in your REF workflow with the Particle Call. The configuration as it stands currently is sending only “REF” through the function. I believe you are trying to send the label value that was selected on the dashboard, such as “RF2” and “RF3,” but the only thing being sent is “REF,” so you may be printing that you have no data as “REF” is not a conditional in your Particle function.

**Applied Changes Examples**

You are currently getting two values from your dashboard, “REF” and the value selected by the dashboard user. These are some changes I would recommend to make this easier on yourself!

 ![14%20PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/2c827bd20fb25fbb2b9de345daf8be158459211f.png)  
The first is to remove “value” and replace “label” with “REF”, so your payload will look like this with only one value:  
 ![54%20PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/da1cb4ddb77fd73da6fdb58c95180d2c733058df.png)

The second change is in the Particle Call configuration:

 ![27%20PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/5/5125cfa228bc837a08d48e377caf083f29a299be.png)

These steps should clear up some confusion and hopefully fix your Particle node!  
Let me know if I can help further,  
Julia

---

<div class="post-metadata">

**Author:** ![Tron7](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@Tron7](https://forums.losant.com/u/Tron7)\
**Post date:** [March 27, 2019, 3:27am UTC](https://forums.losant.com/t/particle-call-settings/1652/3 "2019-03-27T03:27:58Z")

</div>

Hi Julia  
I made the suggested changes but we’re still the same.😅  
What another point can consider?  
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:** [March 27, 2019, 2:05pm UTC](https://forums.losant.com/t/particle-call-settings/1652/4 "2019-03-27T14:05:47Z")

</div>

Hi @Tron7,

I recommend setting up your Particle Call Node with a Result Path so we can see what is returned by the function call, like so:

 ![20%20AM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/c13c07cf68d6df448d3d3fee43dfaf720895dd28.png)

Then we will be able to debug further. 😄

Thanks,  
Julia

---

<div class="post-metadata">

**Author:** ![Tron7](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@Tron7](https://forums.losant.com/u/Tron7)\
**Post date:** [March 28, 2019, 4:36am UTC](https://forums.losant.com/t/particle-call-settings/1652/5 "2019-03-28T04:36:49Z")

</div>

Hi Julia !  
Please see attached pic.  
I applied the modification adding Result Path.  
The following picture is the result for some instant after I click on SET SELECT key on the Dashboard. It show error 403.  
At the very right you can see at Real Term terminal where I am sending the result of the function call from Losant. " Hello" is sent always but if the function call would work you would see like : ref = “10” or ref =“20”.  
Very much for your help.

 ![Workflow%20-%20Dasboard](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d7c913548c02008fd62ce66efb8b40e5c610f9ed.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:** [March 28, 2019, 3:53pm UTC](https://forums.losant.com/t/particle-call-settings/1652/6 "2019-03-28T15:53:12Z")

</div>

Hi @Tron7,

I see a couple more things that could be causing some problems, let’s dive in:

The first is in your Particle Call Node configuration. The Device ID is set to your Losant Device ID, but should be set to your Particle Device ID. If the selected Particle integration is configured for a single device, this field is optional - otherwise it is required. [This blog post](https://www.losant.com/blog/how-to-integrate-particle-with-losant) has a helpful section titled “How To Call a Function on the Particle Board” that details the configuration of this node. The documentation can also be found [here](https://docs.losant.com/workflows/outputs/particle-call/).

The other problem you might run into is with your Particle function code. The first line of your code is `Particle.function("refSel",selection)`, but in your Particle Call Node configuration, you have the name set to “selection.” I would recommend changing this line to `Particle.function("selection",selection)` so the function can be correctly called with your current node configuration.

Let me know if your problem continues and I will look again! 😀

Thanks,  
Julia

---

<div class="post-metadata">

**Author:** ![Tron7](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@Tron7](https://forums.losant.com/u/Tron7)\
**Post date:** [March 29, 2019, 2:33am UTC](https://forums.losant.com/t/particle-call-settings/1652/7 "2019-03-29T02:33:06Z")

</div>

Hi Julia thanks so much for your help. !!!  
I does work.😂  
Really, I interpreted **Device Id** like Losant Device ID and also did the difference to  
register the function like "Particle.function(“selection”,selection); "  
Thanks so much again.  
Best regards,

---

<div class="post-metadata">

**Author:** ![Tron7](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@Tron7](https://forums.losant.com/u/Tron7)\
**Post date:** [April 9, 2019, 3:20pm UTC](https://forums.losant.com/t/particle-call-settings/1652/8 "2019-04-09T15:20:29Z")

</div>

Hi Julia

May be you can help me with this.  
As you know my dashboard is using Gauge block and Indicator block.  
I can manage the decimal places for the gauge block.  
I trying to do the same with the indicator block and I don’t find the way to reduce to 2 decimal places on it, always display at least 4 decimal places.  
Thank you for your help.

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [April 9, 2019, 3:34pm UTC](https://forums.losant.com/t/particle-call-settings/1652/9 "2019-04-09T15:34:43Z")

</div>

Hi @Tron7,

Indicator Block labels are templatable. This means you can use all the helpers we have here:

> **[Accessing Payload Data](https://docs.losant.com/workflows/accessing-payload-data/#format-helpers)**
>
> Learn more about Losant workflows: how to work with and access payload data.

There is one helper in particular called the `format` helper. You can see it in use in the Indicator Block documentation: [https://docs.losant.com/dashboards/indicator/#conditions](https://docs.losant.com/dashboards/indicator/#conditions)

Behind the scenes it’s using D3 Format to format numbers. Here is a really good blog post explaining it: [http://koaning.s3-website-us-west-2.amazonaws.com/html/d3format.html](http://koaning.s3-website-us-west-2.amazonaws.com/html/d3format.html)

Here is an example:

If given the number `10101` at `value-1` and the helper `{{format value-1 '.2f'}}`. You will get: `10,101.00`.

Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![Tron7](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@Tron7](https://forums.losant.com/u/Tron7)\
**Post date:** [April 9, 2019, 3:37pm UTC](https://forums.losant.com/t/particle-call-settings/1652/10 "2019-04-09T15:37:35Z")

</div>

@anaptfox OK thanks and congrats for your Losant University Training !
