# 8 Player Texas Hold Em - How do i pull the data to each .html

**URL:** <https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269>\
**Category:** General\
**Tags:** uibuilder\
**Created:** [16 February 2023 04:34 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269 "2023-02-16T04:34:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fulldad](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fulldad](https://discourse.nodered.org/u/fulldad)\
**Post date:** [16 February 2023 04:34 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/1 "2023-02-16T04:34:23Z")

</div>

I want to have 9 different HTML logins. 1 for the community cards to be displayed and then 8 other people who login to /player1 /player2 /player3 etc. I am only using the example and I am running into a road block. I have been reading and searching forums. I can send the topic successfully back to the player1.html but i don't know how to capture the values from it.

I am using a sql backend to shuffle and track all of my poker data. I am sure this is something simple but would love any help. Posting code probably will not help because I am not too far off from the saimple. I made a player1.html and copied the contents of the other one.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f51551c32844f29f31bce794fd0f297202f4367a.png)

UIBuilder is pretty amazing

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 February 2023 06:02 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/2 "2023-02-16T06:02:14Z")

</div>

In concept:

Create 1 page.  
All players will use that page but use something like querystring parameters to indicate who is who.  
Send all the data to that page with mappings like `{player:1, cards:[]}`.  
In the page: if player === x then do stuff, same for sending back.

---

<div class="post-metadata">

**Author:** ![fulldad](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fulldad](https://discourse.nodered.org/u/fulldad)\
**Post date:** [16 February 2023 06:08 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/3 "2023-02-16T06:08:24Z")

</div>

I appreciate that but i don't think i could pull that off. i want to store all the data inside of sql. my idea is that i click "deal new deck" and it just shuffles and sends out a new hand and pulls from sql.

I don't knw how to use elementid i think or something

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 February 2023 11:51 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/4 "2023-02-16T11:51:46Z")

</div>

You are lucky that you are starting this project now rather than 6 months ago 😁

You will want to turn on one of the advanced options in uibuilder:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/99b12d3f2f30e7137c9810a9feabbb915a597dc6.png)

Turning on the "include `msg._uib`" option will result in you getting some additional information back from the client when you send a msg back to Node-RED:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/72c4de7730e8e27ca9d5832814f43a394ce78ac5.png)

As you can see, you get the `pageName` and a `clientId`. Your initial focus should probably simply be the page name. If you wanted some additional security, you could also check that each page comes from the same client id.

---

<div class="post-metadata">

**Author:** ![fulldad](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fulldad](https://discourse.nodered.org/u/fulldad)\
**Post date:** [17 February 2023 00:47 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/5 "2023-02-17T00:47:15Z")

</div>

You guys are great, thank you. I am going to try this tonight and see if i can make some progress. This gives me a lot of hope. Are there any examples of something that would be somewhat similar to this? pulling data from a sql db and then sending it to multiple pages?

---

<div class="post-metadata">

**Author:** ![fulldad](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fulldad](https://discourse.nodered.org/u/fulldad)\
**Post date:** [17 February 2023 01:04 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/6 "2023-02-17T01:04:34Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/2/12b16a31e2e8fc573f87fe47c935f4af49114ba0.png)  
okay so i turned that on but then i turned it back off because i wanted to see what it actually did and i noticed that it already has the file name in the log files.

SELECT \* FROM `hands` WHERE `hand-id` = 4

So i can send this successfully back to index.html and the query runs, but i don't know what to do with the output. I'm just doing "heads up " for right now, so i ust need to send this array to the player templates i made. I am just going to make 8 different templates, so 9 different templates.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4db9e69d8c7ec2fe3bd83a92652023f03b4afcea.png)

---

<div class="post-metadata">

**Author:** ![fulldad](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fulldad](https://discourse.nodered.org/u/fulldad)\
**Post date:** [17 February 2023 01:10 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/7 "2023-02-17T01:10:49Z")

</div>

I need one template to display the community cards in the middle of the table and then yeah, i just need a player template per player.

My idea is that they load ./player1.html and ./player2.html and that activates them inside of the sql database. My sql query would just have a AND with "IsPlaying" != null.

That way when we hit "deal new hand" it will only deal out cards for those that are marked as ready.

I am doing something very similar to this in another project but i'm not using UIBuilder and i just need a little bit more XP in doing this html stuff as well

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 February 2023 11:52 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/8 "2023-02-17T11:52:30Z")

</div>

> [@fulldad](#):
>
> okay so i turned that on but then i turned it back off because i wanted to see what it actually did and i noticed that it already has the file name in the log files.

You are looking at a control msg there and yes, that already has the data. But if you want to track user actions, you will want the data on the standard messages as well.

> [@fulldad](#):
>
> I am doing something very similar to this in another project but i'm not using UIBuilder and i just need a little bit more XP in doing this html stuff as well

You may need to track, in node-red, the mapping between the player page and the socket id. The easiest way to send a message to a specific player will be to include the msg.\_socketId when you pass the msg to uibuilder. That way it will only go to that connection. Just note that if a player were to loose their connection to Node-RED and then it restarts (e.g. the device went to sleep for a while), the socket id will change. That's why you need a mapping with the page name.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 April 2023 11:53 UTC](https://discourse.nodered.org/t/8-player-texas-hold-em-how-do-i-pull-the-data-to-each-html/75269/9 "2023-04-18T11:53:12Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
