# Viability for this? Touch screen login/out project

**URL:** <https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966>\
**Category:** General\
**Created:** [26 June 2024 09:17 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966 "2024-06-26T09:17:19Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 02:58 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/61 "2024-07-02T02:58:41Z")

</div>

# Maybe?

```auto
const name = msg.payload

// Assuming the msg payload contains the name of someone entering
const attendance = flow.get('attendance') || {}

let x = attendance[name]?.present
if (x == undefined)
{
    //
    node.status({text:"ONE"})
    attendance[name] = { "in": new Date(), "present": true }
    flow.set('attendance', attendance)
}
else
{
    //
    node.status({text:"TWO"})
    attendance[msg.payload] = { "out": new Date(), "present": false }
    flow.set('attendance', attendance)
}

```

This is given the name coming in is _valid_.  
Rather than this "in" and "out" just the time and the "present" indicates if they were coming in or going out.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 03:27 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/62 "2024-07-02T03:27:55Z")

</div>

So with this as a starting block/point.

```auto
[{"id":"7259b305663811d4","type":"inject","z":"f838263ce79e696b","name":"Create attendance array","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"RESET","payloadType":"str","x":220,"y":300,"wires":[["b335992cc023d801","7d23bb2bbef09cf3"]]},{"id":"3debcbb5496f6fa6","type":"inject","z":"f838263ce79e696b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Andrew","payloadType":"str","x":180,"y":440,"wires":[["b64d03446caae4fb"]]},{"id":"dfeb03e0598f9afc","type":"inject","z":"f838263ce79e696b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Barney","payloadType":"str","x":180,"y":480,"wires":[["b64d03446caae4fb"]]},{"id":"16ec9f717ac04713","type":"inject","z":"f838263ce79e696b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Barry","payloadType":"str","x":180,"y":520,"wires":[["b64d03446caae4fb"]]},{"id":"6301dc94c94613ad","type":"inject","z":"f838263ce79e696b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Clive","payloadType":"str","x":180,"y":560,"wires":[["b64d03446caae4fb"]]},{"id":"0782f361710d99e1","type":"inject","z":"f838263ce79e696b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Colin","payloadType":"str","x":180,"y":600,"wires":[["b64d03446caae4fb"]]},{"id":"7d23bb2bbef09cf3","type":"function","z":"f838263ce79e696b","name":"try 2","func":"const name = msg.payload\n\nif (name == \"RESET\")\n{\n // Really a bit more to be done here.\n // But for now.\n flow.set('attendance',{});\n node.status({text:\"NEW DAY\"})\n return;\n}\n\n// Assuming the msg payload contains the name of someone entering\nconst attendance = flow.get('attendance') || {}\n\nlet now = new Date().toLocaleString()\n\nlet x = attendance[name]?.present\nif (x == undefined)\n{\n //\n node.status({text:\"IN\"})\n attendance[name] = { \"time\": now, \"present\": \"in\" }\n flow.set('attendance', attendance)\n}\nelse\n{\n //\n node.status({text:\"OUT\"})\n attendance[msg.payload] = { \"time\": now, \"present\": \"out\" }\n flow.set('attendance', attendance)\n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":440,"wires":[[]]}]

```

No foreign nodes.

I added a `RESET` just to help in testing.

So, where I'm stuck.

Different node.

I need it to load the `attendance` from the flow and make a list of all who have NOT signed out that day.

Again, I have **NO IDEA** what to do or even how to.

Hints?

# EDIT

New code for the `function` node:  
Helps with keeping track of what's going on.  
Maybe not too important, but ....

```auto
const name = msg.payload

if (name == "RESET")
{
    // Really a bit more to be done here.
    // But for now.
    flow.set('attendance',{});
    node.status({text:"NEW DAY"})
    context.set("count",0)
    context.set("ppl",0)
    return;
}

let ppl = context.get("ppl") || 0
context.set("ppl", ppl)
let count = context.get("count") || 0
let text = ""

// Assuming the msg payload contains the name of someone entering
const attendance = flow.get('attendance') || {}

let now = new Date().toLocaleString()

let x = attendance[name]?.present
if (x == undefined)
{
    //
    //node.status({text:"IN"})
    text = "IN"
    ppl = ppl + 1
    context.set("ppl", ppl)
    count = count + 1
    context.set("count", count)
    attendance[name] = { "time": now, "present": "in" }
    flow.set('attendance', attendance)
}
else
{
    //
    //node.status({text:"OUT"})
    text = "OUT"
    ppl = ppl - 1
    context.set("ppl", ppl)
    attendance[msg.payload] = { "time": now, "present": "out" }
    flow.set('attendance', attendance)
}
node.status({text:ppl + " " + text + " " + count})

```

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [2 July 2024 08:24 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/63 "2024-07-02T08:24:56Z")

</div>

I've not read all of your posts, but wouldn't a database make life easier?  
Something like mysql or mariadb.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 09:15 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/64 "2024-07-02T09:15:02Z")

</div>

Hi Paul.

Well, _yes and no_.

The thing is the **REAL** members list would be on another machine and I am not sure of it's structure.

But I doubt it would be directly usable in ~~this~~ any case.  
So I would access it, strip/reformat it to what is needed here and use that.

(Probably not the best way, but the only way of which I can think at this point.)

And:

I am just playing with it to get the _flow_ (excuse the pun) of things.

I think this would be about 2 or 3 steps down the line of things done.  
And I have more to yet do. ☹😉

Could you help me with how to search the.... _object_ (?) (array?)

```auto
{
 "Andrew":{"time":"02/07/2024, 7:11:57 pm","present":"in"},
 "Barney":{"time":"02/07/2024, 7:13:14 pm","present":"in"}
}

```

To find any/all which match the `present` as being `in`?  
When I am doing this search it is expected the value to be `out`.  
But I need a way to get a list of anyone who hasn't _gone home_.

That's where I'm kind of stuck just now.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [2 July 2024 09:36 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/65 "2024-07-02T09:36:21Z")

</div>

Are you expecting people to remember to sign out?  
Basic human psychology suggests it won't [always] occur to them.  
After forgetting once and seeing no consequences they won't bother next time either.

If I were coding this I would definitely use a lightweight database eg SQLite on the Node-red machine.

All the insert, update, delete, request operations (there's an acronym for that but it's crud) are already available via SQL.  
Data integrity is ensured, easy to sync with your master database, ...

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 09:41 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/66 "2024-07-02T09:41:50Z")

</div>

It is a kind of requirement.  
As is we have a book.

It may be EASIER if people could use a `puta to make it easier/quicker than picking up a pen, looking at what time it is and writing it down.

I have ABS(NO) idea of how to use databases.  
I tried 30 years ago to try and get into databases, and failed.

The structure I'm using here/now is just to get things working.  
When working, I could (maybe) change things.

But at this stage, it is all just scaffolding and frame work to get the idea of how to do it.

## Why do we need to sign out?

Well, it is _closing time_ and people leave.  
The _person in charge for that day_ has to lock up.  
The look at the list and if there are people not signed out MAY have had an accident and be lying there..... die ing. (how ever it is spelt)

So a list of people showing who has NOT signed out is kind of needed.

---

<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:** [2 July 2024 10:08 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/67 "2024-07-02T10:08:43Z")

</div>

> [@Trying\_to\_learn](#):
>
> File: on local machine for testing.
> 
> ```auto
> cat members.txt 
> {
> "name":"Andrew","status":"",
> "name":"Barney","staus":""
> }
> 
> ```

Not quite:

```auto
{
  "Andrew Jones": {
    "entrance": "2024-07-02T15:24:03Z",
    "exit": null,
    "present": true,
  },
  ...
}

```

Of course, you then have to deal with name clashes - so you may need to add something extra to a name if you get a clash.

What you gave is not valid JSON because it should look like this:

```auto
[
  { "name":"Andrew","status":"" }
  { "name":"Barney","staus":"" }
]

```

Which could also work but is slightly more code because you now need to constantly filter the array. Since your system works by name, best to make the name the key and now you no longer have to filter anything, you can get to it immediately.

> [@Trying\_to\_learn](#):
>
> So I have to have the entire list of members _loaded_ also?

Wherever you will be processing the entry/exit, you will need the full list - OR, if you are processing in the front-end browser, you would have to constantly ask the server for updates. But that is not only inefficient but also fragile if the network is fragile.

As long as the list isn't too massive (e.g. \<10k or so entries), just blast it down to the device in the morning and be done with it.

> [@Trying\_to\_learn](#):
>
> So now i have to created a list of people who have _interacted with the system TODAY_.

The structure I've shown IS the today list. Your master list of names will look a little different because you need different info for management reporting. Maybe something like:

```auto
{
  "Andrew Jones": {
    "lastEntrance": "2024-07-02T15:24:03Z",
    "signedUp": "2021-02-05T15:24:03Z",
    "feesDue": "2025-02-05T15:24:03Z",
    "attendance": {
      "2024-01": 3,
      "2024-02": 1,
      ...
    },
  },
  ...
}

```

Or whatever you want in the info - you don't need to decide immediately. The important part is the list of names.

> [@Trying\_to\_learn](#):
>
> And why is it `new Date()` and not `new_Date()`?

`new Date()` gives you the CURRENT DATE, `new_Date()` would need you to write a function that returns the current date - no need for that.

Sorry, out of time for now, have to work.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [2 July 2024 10:23 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/68 "2024-07-02T10:23:22Z")

</div>

Andrew have you ever used ChatGPT or similar ?

While it may not write the whole flow for you, and you will likely need to adapt the code it does provide, it can be a helpful nudge when you get stuck on something.

As a test I just copied your exact post above, I added the first bit about Node red so that it knows what context the question is in. This is the code and a screen shot.

```auto
// Assume the input payload is the given object
let input = msg.payload;

// Initialize an empty array to store matching entries
let matchingEntries = [];

// Loop through each key in the input object
for (let key in input) {
    // Check if the "present" value is "in"
    if (input[key].present === "in") {
        // Push the matching entry (with the key) to the array
        matchingEntries.push({ name: key, ...input[key] });
    }
}

// Set the result as the payload
msg.payload = matchingEntries;

// Return the message object
return msg;

```

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

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 10:26 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/69 "2024-07-02T10:26:15Z")

</div>

Thanks,

(in reverse order)

Yeah, I studied `new date()` and got it. I adjusted it to `new date()..toLocaleString()` just so it didn't mess we more.

Yes, the list (flow.context) is just a list of that day's activity.

The members list is about 150.

The structure - from the start.

I only used first names because I am shocking at creating names and the 5 names were for testing only to check the mechanics of it working.

When I tried the extended structure with the

```auto
[
  { "name":"Andrew","status":"" }
  { "name":"Barney","staus":"" }
]

```

> [@TotallyInformation](#):
>
> because you now need to constantly filter the array.

That's done with this line - yes?  
`let x = attendance[name]?.present`

It would only happen when people sign in/out.

## Ok, going back 1 step from what I posted. Getting the list of members.

The idea is that once a day the members list would be _imported_ to this machine from the main machine. (Just a thought of how it would happen)

That is stored - either in a file or flow.context.  
That is a _layer_ which presents the names (first / last) when someone wants to log in.  
Those buttons are created from that list.

The button is pressed and the name (first / last) is passed to this bit of code and the _object_ is modified to indicate they have signed in today. And later them signing out.

I'll stop here as I think I've now got too many steps/phases of the code in the discussion.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 10:32 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/70 "2024-07-02T10:32:14Z")

</div>

Alas no, I have never used `chat GPT`.

It may be nice and I've looked at a couple of the pictures.

Alas it (chatGPT) is as guilty as all the sites I've visited in it doesn't _explain_ the commands use and how they work.

So as much as the code would/could/nearly would work:  
I don't really understand what it is doing. (Or is that HOW it is doing it?)

_HOW_ do I use `chatGPT`?  
I heard - also- that it is very VERY popular and so is somewhat difficult to get onto.

I'll look at the rest of the screen shots now - after posting.

---

<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:** [2 July 2024 10:36 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/71 "2024-07-02T10:36:38Z")

</div>

> [@Trying\_to\_learn](#):
>
> Alas it (chatGPT) is as guilty as all the sites I've visited in it doesn't _explain_ the commands use and how they work.

Actually it often does as in this example:

[https://chatgpt.com/c/d09e726d-c572-4e50-ab4e-6edb9b385ea8](https://chatgpt.com/c/d09e726d-c572-4e50-ab4e-6edb9b385ea8)

> [@Trying\_to\_learn](#):
>
> so is somewhat difficult to get onto.

Not any more.

> [@Trying\_to\_learn](#):
>
> _HOW_ do I use `chatGPT`?

Ask it a question, check the answer carefully.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 10:37 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/72 "2024-07-02T10:37:35Z")

</div>

Unable to load conversation d09e726d-c572-4e50-ab4e-6edb9b385ea8

---

<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:** [2 July 2024 10:38 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/73 "2024-07-02T10:38:19Z")

</div>

Try this link:

> **[ChatGPT](https://chatgpt.com/share/55e0fa1d-0b5f-46ab-aea8-dd54b53b8468)**
>
> A conversational AI system that listens, learns, and challenges

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [2 July 2024 10:40 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/74 "2024-07-02T10:40:03Z")

</div>

> [@Trying\_to\_learn](#):
>
> I'll look at the rest of the screen shots now - after posting.

If you do look at the screen shots you will see it answers your comments.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 10:46 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/75 "2024-07-02T10:46:49Z")

</div>

Yeah, sorry Steve....

There are only 2 screen shots. I thought (incorrectly) there were more.

Looking - and not complaining - but it doesn't seem to handle the person signing out.  
Or - probably - I'm not _seeing_ it.

It is going to be painful _copying_ the code from ~~those~~ that screen shot to test it.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 10:47 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/76 "2024-07-02T10:47:06Z")

</div>

(Sorry Julian)  
The link has generic code.  
Fair enough, but I am still not smart enough to know how to _combine_ the two blocks.  
The `html` and `js`.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [2 July 2024 10:58 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/77 "2024-07-02T10:58:38Z")

</div>

Well, this code:

```auto
let input = msg.payload

let matchingEntries = []

for (let key in input)
{
   if (input[key].present === "in")
   {
      matchingEntries.push({name:key, ...input[key] })
   }
}

msg.payload = matchingEntries

return msg;

```

Sending it my example names (no last names though) all I get is `[empty]` in the `debug` on each injection of a name.

And I just now realised the code was in @Sean-McG post. Oh, gee I am not doing my self any favors.

 ![Screenshot from 2024-07-02 21-05-45](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1c1f8a27c59693718f6c90b17ca3ebff501ddecf.png)

(groan - sorry. I've sat here for .... about 5 hours today not moving. My body hurts. It is now 21:08. I think it is enough for today. Started about 09:00 today.)

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [2 July 2024 11:37 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/78 "2024-07-02T11:37:49Z")

</div>

If you look at the screen shot you will see your earlier post, entered into chatGPT.

The resulting code is the answer to your question, about

> [@Trying\_to\_learn](#):
>
> Could you help me with how to search the.... _object_ (?) (array?)
> 
> ```auto
> {
> "Andrew":{"time":"02/07/2024, 7:11:57 pm","present":"in"},
> "Barney":{"time":"02/07/2024, 7:13:14 pm","present":"in"}
> }
> 
> ```
> 
> To find any/all which match the `present` as being `in`?

Take a deep breath and carefully read and digest my post 😉

You will see in the screen shot an example of the input, I guess this would come from your "attendance" variable.

{  
"Andrew": {"time": "02/07/2024, 7:11:57 pm", "present": "in"},  
"Barney": {"time": "02/07/2024, 7:13:14 pm", "present": "in"},  
"Charlie": {"time": "02/07/2024, 7:15:30 pm", "present": "out"}  
}

and an example of what the function will output

[  
{  
"name": "Andrew",  
"time": "02/07/2024, 7:11:57 pm",  
"present": "in"  
},  
{  
"name": "Barney",  
"time": "02/07/2024, 7:13:14 pm",  
"present": "in"  
}  
]

---

<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:** [2 July 2024 13:11 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/79 "2024-07-02T13:11:50Z")

</div>

> [@Trying\_to\_learn](#):
>
> Fair enough, but I am still not smart enough to know how to _combine_ the two blocks.  
> The `html` and `js`.

JavaScript is combined into a web page by using a `<script>` tag. That can either contain in-line JS or it can load it from a URL.

All UIBUILDER examples and templates use a standard set of 3 files: `index.html`, `index.css` and `index.js`. The links to the css & js files are already included in the `index.html` file. Though, for the default blank template, the js file is commented out since it often isn't now needed for simple use cases.

---

<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:** [2 July 2024 13:20 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/80 "2024-07-02T13:20:51Z")

</div>

Here is a ChatGPT prompt that you might find helpful for your testing. 😀

> Please generate me a list of 100 random people names (given-name family-name) that would be found in Australia. Return the list as a JavaScript array of strings where each entry is in the format given-name space family-name.

[Previous page](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966.md?page=3)

[Next page](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966.md?page=5)
