How do i store a calculated IP in a custom state?

I’ll share how something like this is set up in my apps.

First, when a page is loaded, I use the Element Action → Set State workflow and I set a custom state of type text on a floating group (doesn’t have to be a floating group, but this is the only element that exists on every page of this app so it’s a good place to store things like user IP):

Then, since I only want to record IP entries from logged in users, I create a new type of thing in my app I call Log_Entry whenever a user is logged in:

This is a generic type of thing that I modify to fit the situation. In this case, I want to create a record about the current logged in user’s IP among other things like their name and ID.

Essentially, once you have the IP stored as a state, you can reference this state when running other workflows (in my case, when a user is logged in → create log entry → IP Address = stored value).

I’ve found creating generic logs like this for all user actions to be extremely handy when I want to parse user data later on.

1 Like