Posting to field2 in thingspeak

I think the problem is Particle throttling events, so only one of the webhooks is activated if two Publish events occur too close together. However, you CAN send multiple data items using one webhook and one call to Particle.Publish().

In the Particle Console, in the webhook definition, presuming you followed the ThingSpeak example, in the forms section you should see:
{
“api_key”: “your_ThingSpeak_API_Key”,
“field1”: “{{PARTICLE_EVENT_VALUE}}”
}

The {{PARTICLE_EVENT_VALUE}} is the event value Particle automatically fills in, but there’s only one of those. So EDIT the form (bottom of page) click on Advanced Settings and make sure the third radio button is selected (the Form button).

api_key should be the first row - leave it.

The second row should contain field1 and {{PARTICLE_EVENT_VALUE}}.
Replace the "{{PARTICLE_EVENT_VALUE}} with {{field1Val}}
then click the add row button and enter field2 in the left hand box, and {{field2Val}} in the right hand side. (I assume your ThingSpeak fields are indeed field1 and field2).

Save that, and in the summary it should now show:
{
“api_key”: “your_ThingSpeak_API_Key”,
“field1”: “{{field1Val}}”,
“field2”: “{{field2Val}}”
}

Then, in your program, to send both values in one publish call, you need to send a JSON string using field1Val and field2Val as identifiers, along with the relevant values as quoted strings- I used snprint to send a float and an int in JSONbuffer, a cstring:

snprintf(JSONbuffer, sizeof(JSONbuffer),{“field1Val”:"%f",“field2Val”:"%i"}\n",floatvalue,intvalue);
Particle.publish(“eventname”,JSONbuffer,PRIVATE);

This worked for me- good luck. Others have written extensive analysis about Mustache templates, specifically rickkas7 whose Webhook Tutorial led me to this solution. Webhook intermediate tutorial