# Questions about my project

**URL:** <https://community.particle.io/t/questions-about-my-project/41216>\
**Category:** Cloud\
**Created:** [April 17, 2018, 10:15pm UTC](https://community.particle.io/t/questions-about-my-project/41216 "2018-04-17T22:15:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fufo](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@fufo](https://community.particle.io/u/fufo)\
**Post date:** [April 17, 2018, 10:15pm UTC](https://community.particle.io/t/questions-about-my-project/41216/1 "2018-04-17T22:15:57Z")

</div>

Hi I’m having some questions of how to interact with the data that I already is in published in the console, this is my photon code.

void setup(){  
Particle.function(“web”, num);  
}  
void loop()  
{}  
int num(String command){  
Particle.publish(“Console”, command);  
}

the idea is that when I enter a data in a web page the number that is sent is registered in the console and also as a variable that can be added or subtracted afterwards. This code I already checked in other tutorials, but I get stuck in that part.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [April 18, 2018, 1:32am UTC](https://community.particle.io/t/questions-about-my-project/41216/2 "2018-04-18T01:32:30Z")

</div>

Hi @fufo

It is not safe to call Particle.publish from inside a Particle.function(). Eventually this will be made to work but now it mixes up the messages to/from the cloud. Instead you should copy the String (or better yet char array) to a global copy in your function and then set a flag so that next time your code gets to the loop() function is can do the publish from there and clear the flag.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [April 18, 2018, 11:05am UTC](https://community.particle.io/t/questions-about-my-project/41216/3 "2018-04-18T11:05:25Z")

</div>

The published events are not only sent to the Particle Console, but you can subscribe to these SSEs with any software you like, but the [Particle API JS (JavaScript SDK)](https://docs.particle.io/reference/javascript/#get-event-stream) would be the common and easiest way to do it.

But about this

> [@fufo](#):
>
> Hi I’m having some questions of how to interact with the data that I _ **already is in published** _ in the console

There currently is no way to have _access_ to historic events. If you didn't catch it when it was thrown, you've missed the chance.
