PadCodedocs

Add to List

Adds an item to a list, like a new note or a new expense.

Category: Data

#When to use it

Use it to add something new to a list: a note, an expense, a tag, a set at the gym.

#Example

A tag editor's Add button, where tags is a List of Text and newTag is what's typed:

  1. Add to List: State: tags, Item: ⚡︎ → Formula… trim(newTag), At: Start.
  2. Reset Value: State: newTag, to empty the field.

#Good to know

  • Everything that shows the list, like a Repeater, updates at once.
  • At: End (the default) adds to the bottom; Start puts the newest first.

#Add it

Select a view, open the Inspector's Actions tab, pick when it runs, tap Add action and choose Add to List (under Data). Tap the step to open its settings.

#Settings

SettingWhat it doesKindDefault
StateThe list.VariableRequired
ItemWhat to add. Usually an object, like { "title": …, "done": false }.Any valueRequired
AtAdd to the end or the start.Choice: End, Startend

#See also