Machine variables

Variables of type machine can’t be used in the expression editor. This would be a useful addition, at a minimum to convert the machine name to a string value.

Is it possible to store a text value as a machine variable? (my use cas is to pairing mobile device/machine when i started my application) A kind of TEXTTOMACHINE() function?

I have this problem now, too. I designed myself into a corner. What I did was I created a screen (step) where you can pick a machine, then I pass that machine into the next step as a variable of type Machine. Now on that second screen I’m trying to get the machine’s name and current state, and I don’t see that it’s possible.

Hi @wz2b!

We are actually looking at Machine variables right now, with the goal of exposing the properties like name and state. We don’t have a specific timeline yet, but are trying to nail down the details. How does the rest of that app work? e.g. What will you do with the name and state if you had access?

I’m making a very light weight equipment maintenance tracker. Really light, it’s an app with 3 steps. One screen lets you pick the equipment, at which point you can either go to a PM screen or a machine state logbook. In our workflow, an operator can change a machine to ‘down’ but a maintenance person has to re-enable it with a comment.

The PM screen has a schedule. I made a custom table widget that takes the PM schedule and sorts it by when the maintenance activity is due, showing a short time into the future and past. My table widget highlights things that are past due by coloring the rows differently. I also implemented css :hover to make it feel a little nicer.

I’m really glad you included moment. The dates come through the API as strings, so I’m pulling the table column descriptions out of the API to figure out which of these strings is actually a datetime, then converting them to moments. At that point, it’s just if completed == false && due.IsBefore() to figure out which ones to .addClass(“pastDue”) to.

In the short term, I’m just going to make a table to shadow the built-in list of machines. That’s probably good enough for now. I’d be happier working with an immutable ID rather than the machine’s “name” but it’s fine for now. Eventually I’m imaging a Machine will look more like an object with properties – or perhaps it’ll just look like another Table. Either way would be fine.

Here, I can share …

I’d really like to make my table widget a lot smarter and more general-purpose. It’s just a little messy entering the configuration in no-code. I configure it like this:

I think if I could do anything I wanted to the table widget I would want to be able to send in more formatting, like column widths, and some more sophisticated things, like coloring rules. (For now, I hard code that colors are based on a column named “due” which is not very flexible).

The other thing I’d like to improve is that I assume if it’s a boolean field you want it displayed as a green checkmark or a red X. It would be nice to make that flexible, too. Maybe that could be an overall widget parameter though rather than a column specific one.

I think if I could feed a hunk of JSON into a text that might be more flexible, but doing it that way sort of ruins the “no code” feel.

1 Like

Wow, great work and thanks for the detailed information!