Skip to main content

Users Field (Lua)

Accessing data in the users field

Anthony Greco avatar
Written by Anthony Greco
Updated over a week ago

The users field contains a list of user names that can be accessed via lua. For example:

Example field slugs

- Other User: `user`

- Count of User Name: `user_count`

- List of User Names: `list`

Returns a count of users entered into the users field:

local count = 0

for _ in pairs(answers.user or {}) do

count = count + 1

end

answers.user_count = count

Returns a comma delineated list of users' names:

answers.list = answers.user

Did this answer your question?