Formulas
Collections
Count(list)
Copy linkCounts the size of a list
Planets.Count()
Planets.Filter(Moons.Count() > 1)
Inputs
- list...
- A table, column, or list of values
Output
Outputs the count of non-blank values in list(s).
CountUnique(value)
Copy linkCounts number of unique values
CountUnique(1, 2, 3, 3, 3, 4)
Inputs
- value...
- A value or list of values to be counted
Output
Outputs a count of all of the unique value(s) ignoring duplicates and blank values. Counts each unique item in a value if it is a list.
Find(needle, haystack, startAt, ignoreCase, ignoreAccents)
Copy linkGet the position of a value
Find("world", "hello world")
Find("world", "Hello World", 0, true)
Find("varlden", "hej världen", 0, false, true)
Find(1, List(2, 4, 6))
Find("be", List("to", "be", "or", "not", "to", "be"), 3)
Required inputs
- needle
- A value you wish to find
- haystack
- A string or list you want to find the needle in
Optional inputs
- startAt
- The position to search from. Counts from 1 (default)
- ignoreCase
- Whether to ignore case when searching text. Defaults to false.
- ignoreAccents
- Whether to ignore diacritics (accents, umlauts, cedillas, etc.) when searching text. Defaults to false.
Output
Outputs the first position of needle in haystack starting at startAt, or -1 if not found. Works with text and lists.
MaxBy(list, compareBy)
Copy linkGet the row of a table with the maximum value in the provided column, or item in a list with the maximum value by the provided formula.
Planets.MaxBy(Diameter)
List(3, 5, 7).MaxBy(CurrentValue % 6)
Inputs
- list
- A table, column, or list of values
- compareBy
- A formula to evaluate for each item and compare by. This can be a column if list is a table and can reference CurrentValue.
Output
Outputs the maximum item inlist based on evaluating compareBy over each item. This will return the item in the original list, not the value that is used for comparison - use Max(list.compareBy) instead to only fetch the maximum compared value.
MinBy(list, compareBy)
Copy linkGet the row of a table with the minimum value in the provided column, or item in a list with the minimum value by the provided formula.
Planets.MinBy(Diameter)
List(3, 5, 7).MinBy(CurrentValue % 6)
Inputs
- list
- A table, column, or list of values
- compareBy
- A formula to evaluate for each item and compare by. This can be a column if list is a table and can reference CurrentValue.
Output
Outputs the minimum item in list based on evaluating compareBy over each item. This will return the item in the original list, not the value that is used for comparison - use Min(list.compareBy) instead to only fetch the minimum compared value.
Slice(value, start, end)
Copy linkGet part of a list or text
Slice("Hello world", 5, 9)
List("Cat", "Dog", "Mouse").Slice(2, 3)
Required inputs
- value
- A text string or list of values
- start
- The position to start from. Counts from 1
Optional inputs
- end
- The position to end at. Counts from 1
Output
Outputs a part of the provided value based on the start and end positions.
Sort(dataset, ascending, sortBy, sortByCount)
Copy linkSort a list or column
List(1, 5, 3, 4, 2).Sort()
Planets.Sort(false, Diameter)
Required inputs
- dataset
- A list or column to be sorted
Optional inputs
- ascending
- True for ascending or False for descending. Defaults to True.
- sortBy
- The property of dataset to sort on. Can only be specified if each item in dataset is a row or an object.
- sortByCount
- True to order elements by count or False to order elements by value. Defaults to False.
Output
Outputs dataset in sorted order. Sort order and criteria are specified by the ascending, sortBy and sortByCount inputs.
Splice(value, start, deleteCount, insertValue)
Copy linkRemove and add to a list or text
Splice(List(1, 2, 3, 4, 5), 2, 3, List("Dog", "Cat"))
Inputs
- value
- A list or text to modify
- start
- The position to start from. Counts from 1
- deleteCount
- The number of items or characters to delete
- insertValue...
- The value, text, or list of values to insert
Output
Outputs value with deleteCount values removed and insertValue(s) added at start position.
Dates
Created(object)
Copy linkGet the created date/time for a row or other object
ExampleTable.Created()
Inputs
- object
- A Coda object. This includes tables, views, columns, rows, and docs.
Output
Outputs the created date/time for object.
CurrentTimezone()
Copy linkGet the user's current time zone
CurrentTimezone()
Output
Outputs the user's current time zone.
Date(year, month, day)
Copy linkCreate a date value
Date(1985, 1, 4)
Date(2019, 2, 5)
Inputs
- year
- The year as a number
- month
- The month as a number
- day
- The day as a number
Output
Outputs the date of the provided year, month, and day.
DateTime(year, month, day, hour, minute, second)
Copy linkCreate a date time value
DateTime(1985, 1, 4, 10, 30)
Date(2019, 2, 5, 17, 30, 30)
Required inputs
- year
- The year as a number
- month
- The month as a number
- day
- The day as a number
Optional inputs
- hour
- The hour as a number
- minute
- The minute as a number
- second
- The second as a number
Output
Outputs the date of the provided year, month, day, hour, minute, and second.
DateTimeTruncate(dateOrTime, unit)
Copy linkRound a date/time
Time(1, 30, 45).DateTimeTruncate("minute")
DateTime(2023, 4, 28, 1, 30, 45).DateTimeTruncate("hour")
Inputs
- dateOrTime
- A time or date/time
- unit
- The unit to round to. Can be "year", "quarter", "month", "week", "day", "hour", "minute" or "second".
Output
Outputs dateOrTime rounded to the nearest unit.
DateToEpoch(date)
Copy linkConvert date to epoch
DateToEpoch("3/10/2017 3:14:24 PM")
Inputs
- date
- The date to convert
Output
Outputs date as an epoch time (the number of seconds since Jan 1st, 1970).
Day(dateTime)
Copy linkGet the day-of-month from a date/time
Day(Date(2013, 4, 18))
Inputs
- dateTime
- A date/time
Output
Outputs the day of month of the given dateTime as a number.
DocumentTimezone()
Copy linkGet the document's timezone
DocumentTimezone()
Output
Outputs the document's timezone.
EndOfMonth(dateTime, monthOffset)
Copy linkGet the last day of a given month
EndOfMonth(Today(), 3)
EndOfMonth(Date(2017, 03, 20), 1)
Inputs
- dateTime
- A date/time
- monthOffset
- The number of months to move forward or backwards. 0 is month of dateTime. 1 is the following month, -1 is the previous month.
Output
Outputs the date for the last day of the month of dateTime plus monthOffset.
EpochToDate(epochTime)
Copy linkConvert epoch time to date
EpochToDate(1489187664)
Inputs
- epochTime
- The number of seconds since Jan 1st, 1970
Output
Outputs epochTime as a date.
Hour(dateOrTime)
Copy linkGet the hour from a date/time
Hour(DateTime(1985, 1, 4, 10, 30))
Hour(Time(1, 30, 45))
Inputs
- dateOrTime
- A time or date/time
Output
Outputs the hour of the given dateOrTime as a number.
IsoWeekNumber(dateTime)
Copy linkGet the week number of a date in the ISO week numbering system, where week 1 contains the first Thursday of the year and weeks start on Monday
IsoWeekNumber(Date(2019, 2, 5))
Inputs
- dateTime
- A date/time
Output
Outputs the week of dateTime as a number between 1 and 52.
IsoWeekday(dateTime)
Copy linkGet the day-of-week of a date/time as a number in the ISO week numbering system, where Monday is 1.
IsoWeekday(Date(2019, 2, 5))
Inputs
- dateTime
- A date/time
Output
Outputs the day-of-week of dateTime as a number between 1 and 7.
Minute(dateOrTime)
Copy linkGet the minute from a date/time
Hour(DateTime(1985, 1, 4, 10, 30))
Minute(Time(1, 30, 45))
Inputs
- dateOrTime
- A time or date/time
Output
Outputs the minute of the given dateOrTime as a number.
Modified(object)
Copy linkGet the modified date/time for a row or other object
Table.Modified()
Inputs
- object
- A Coda object. This includes tables, views, columns, rows, and docs.
Output
Outputs the modified date/time for object.
Month(dateTime)
Copy linkGet the month from a date
Month(Date(2013, 4, 18))
Inputs
- dateTime
- A date/time
Output
Outputs the month of the given dateTime as a number.
MonthName(dateTime, format)
Copy linkGet the month name for a date
MonthName(Date(2013, 4, 18))
Required inputs
- dateTime
- A date/time
Optional inputs
- format
- Use "MMM" for appreviated month name, or "MMMM" for full month name.
Output
Outputs the month name for given dateTime as text.
NetWorkingDays(startDate, endDate, holidays)
Copy linkCount working days between dates. Customize working days in region and date settings.
NetWorkingDays(Date(2016, 2, 1), Date(2016, 2, 3))
Required inputs
- startDate
- The date to count from
- endDate
- The date to count to
Optional inputs
- holidays
- A list of dates to exclude from the count (e.g. holidays)
Output
Outputs the count of working days between startDate and endDate excluding holidays. Customize working days in region and date settings.
Now(precision)
Copy linkGet the current date/time
Now()
Optional inputs
- precision
- The precision of the time returned. Valid options are "second" (default), "minute", "hour", and "day", as well as their plural equivalents.
Output
Outputs the current date and time. Updates based on precision specified.
RelativeDate(dateTime, months)
Copy linkAdd months to a date/time
RelativeDate(Date(2016, 1, 1), 2)
Inputs
- dateTime
- A date/time
- months
- Months to add (can be negative)
Output
Outputs months added to dateTime rounded to the day.
Second(dateOrTime)
Copy linkGet the "second" from a date/time
Hour(DateTime(1985, 1, 4, 10, 30, 50))
Second(Time(1, 30, 45))
Inputs
- dateOrTime
- A time or date/time
Output
Outputs the seconds part of the given dateOrTime as a number.
Time(hour, minute, second)
Copy linkCreate a time value
Time(1, 30, 45)
Time(17, 0, 0)
Inputs
- hour
- The hour as a number
- minute
- The minute as a number
- second
- The second as a number
Output
Outputs the time of the provided hour, minute, and second.
TimeValue(time)
Copy linkConvert a time to a number
TimeValue("5:30:18 PM")
Inputs
- time
- A time or date/time
Output
Outputs time as a decimal ratio of the day.
ToDate(text)
Copy linkConvert text into a date value. Respects the doc's date order setting.
ToDate("2013-03-14")
Inputs
- text
- Text in a recognized date format such as "MM-DD-YY" or "YYYY/MM/DD"
Output
Outputs the value of text parsed into a date. Outputs blank if text can't be parsed.
ToDateTime(datetime)
Copy linkConverts text into a date/time. Respects the doc's date order setting.
ToDateTime("2013-03-14 18:13:23")
Inputs
- datetime
- Text in a recognized date format such as "MM-DD-YY HH:MM:SS"
Output
Outputs the value of datetime parsed into a date and time. Outputs blank if datetimecan't be parsed.
ToTime(value)
Copy linkConverts a value into a time
ToTime("5:30:18 PM")
ToDateTime("2013-03-14 18:13:23").ToTime()
Inputs
- value
- A value to convert
Output
Outputs the value of value parsed into a time. Outputs blank if valuecan't be parsed.
Today()
Copy linkGet today's date
Today()
Today() + Days(14)
Output
Outputs the current date. Updates daily.
WeekNumber(dateTime, returnType)
Copy linkGet the week number of a date, where week 1 contains Jan 1. Respects the doc’s first day of week setting. Use "IsoWeekNumber()" if week 1 should contain the first Thursday of the year.
WeekNumber(Date(2019, 2, 5))
Required inputs
- dateTime
- A date/time
Optional inputs
- returnType
- Currently unused parameter
Output
Outputs the week of dateTime as a number between 1 and 52.
Weekday(dateTime, returnType)
Copy linkGet the day-of-week of a date/time as a number. Respects the doc’s first day of week setting.
Weekday(Date(2019, 2, 5))
Required inputs
- dateTime
- A date/time
Optional inputs
- returnType
- Currently unused parameter
Output
Outputs the day-of-week of dateTime as a number between 1 and 7.
WeekdayName(dateTime)
Copy linkGet the day-of-week of a date as text
WeekdayName(Date(2019, 2, 5))
Inputs
- dateTime
- A date/time
Output
Outputs the day-of-week of dateTime as text ("Monday", "Tuesday", etc.).
Workday(startDate, numWorkingDays, holidays)
Copy linkAdds working days to a date. Customize working days in region and date settings.
Workday(Date(2016, 2, 1), 5)
Required inputs
- startDate
- The date to count from
- numWorkingDays
- Number of working days to move the date forward. Customize working days in region and date settings.
Optional inputs
- holidays
- A list of dates to exclude from the count (e.g. holidays)
Output
Outputs a date based on your startDate plus the numWorkingDays you wish to move forward skipping over any dates included in holidays.
Year(dateTime)
Copy linkGet the year of a date
Year(Date(2019, 2, 5))
Inputs
- dateTime
- A date/time
Output
Outputs the year of the given dateTime as a number.
Duration
Days(days)
Copy linkCreate a time duration (for days)
Days(14)
Date(2019, 2, 5) + Days(7)
Inputs
- days
- The number of days
Output
Outputs a time duration for the specified number of days.
Duration(days, hours, minutes, seconds)
Copy linkCreate a time duration
Duration(4, 3, 2, 1)
Optional inputs
- days
- The number of days
- hours
- The number of hours
- minutes
- The number of minutes
- seconds
- The number of seconds
Output
Outputs a time duration for the specified number of days, hours, minutes, and seconds.
Hours(hours)
Copy linkCreate a time duration (for hours)
Hours(12)
Hours(36)
Inputs
- hours
- The number of hours
Output
Outputs a time duration for the specified number of hours.
Minutes(minutes)
Copy linkCreate a time duration (for minutes)
Minutes(3)
Minutes(84)
Inputs
- minutes
- The number of minutes
Output
Outputs a time duration for the specified number of minutes.
Seconds(seconds)
Copy linkCreate a time duration (for seconds)
Seconds(38)
Seconds(80)
Inputs
- seconds
- The number of seconds
Output
Outputs a time duration for the specified number of seconds.
ToDays(duration)
Copy linkConvert a time duration into a number of days
ToDays(Hours(12))
ToDays(Duration(days: 1, hours: 6))
Inputs
- duration
- The time duration to convert
Output
Outputs a number of days for the specified duration.
ToHours(duration)
Copy linkConvert a time duration into a number of hours
ToHours(Minutes(120))
ToHours(Duration(days: 1, hours: 6))
Inputs
- duration
- The time duration to convert
Output
Outputs a number of hours for the specified duration.
ToMinutes(duration)
Copy linkConvert a time duration into a number of minutes
ToMinutes(Seconds(120))
ToMinutes(Duration(days: 1, hours: 6))
Inputs
- duration
- The time duration to convert
Output
Outputs a number of minutes for the specified duration.
ToSeconds(duration)
Copy linkConvert a time duration into a number of seconds
ToSeconds(Minutes(120))
ToSeconds(Duration(days: 1, hours: 6))
Inputs
- duration
- The time duration to convert
Output
Outputs a number of seconds for the specified duration.
Filters
AverageIf(list, expression)
Copy linkCompute the average of a filtered list of numbers
List(1,2,3,4).AverageIf(CurrentValue > 2)
Inputs
- list
- List of numbers or number column
- expression
- A formula returning a boolean value (true or false). Use "currentValue" to reference the current item in the list. When filtering a table, "currentValue" will refer to a row.
Output
Outputs the average of a list of numbers for values matching expression. Blank values are ignored.
CountIf(list, expression)
Copy linkGet the count for a filtered list
Planets.CountIf(Moons.Count() > 1)
CountIf(List(1,2,3,4), CurrentValue > 2)
Inputs
- list
- A table, column, or list of values
- expression
- A formula returning a boolean value (true or false). Use "currentValue" to reference the current item in the list. When filtering a table, "currentValue" will refer to a row.
Output
Outputs the count of values in list for values matching expression. Blank values are ignored.
Filter(list, expression)
Copy linkGets a list of values that match your filter
Fruits.Filter(Color = "Green")
List(1,2,3,4).Filter(CurrentValue > 2)
Inputs
- list
- A table, column, or list of values
- expression
- A formula returning a boolean value (true or false). Use "currentValue" to reference the current item in the list. When filtering a table, "currentValue" will refer to a row.
Output
Outputs a list of all values in list that match expression.
IsFromTable(row, table)
Copy linkCheck if a reference is from a table
IsFromTable(@Bill Clinton, [Presidents])
Inputs
- row
- The row to check
- table
- The table to search
Output
Outputs True if row is a row in table. Otherwise outputs False.
Lookup(table, column, match value)
Copy linkGet the rows from a table that match your filter
Lookup(Tasks, Project, thisRow)
Lookup(Tasks, Status, "Not Started")
Inputs
- table
- The table to get rows from
- column
- The column to search in table
- match value
- The value to search for in column
Output
Outputs the rows from a table where column is the same as match value. We recommend using Table.Filter() instead.
Matches(value, control)
Copy linkChecks if a Coda control matches a value
[Color Column].Matches([Color Select Control])
Inputs
- value
- A value to check against the control
- control
- A control to check against the value
Output
Outputs True if the given value matches the control. Otherwise outputs False.
SumIf(list, expression)
Copy linkCompute the sum for a filtered list
List(1,2,3,4).SumIf(CurrentValue > 2)
Inputs
- list
- List of numbers or number column
- expression
- A formula returning a boolean value (true or false). Use "currentValue" to reference the current item in the list. When filtering a table, "currentValue" will refer to a row.
Output
Outputs the sum of a list of numbers for values matching expression. Blank values are ignored.
Info
IsAnyText(value)
Copy linkChecks if a value is plain text or rich text
IsAnyText("Hello world")
IsAnyText(BulletedList(List("Hello", "world")))
IsAnyText(14)
Inputs
- value
- A value to check
Output
Outputs True if the given value is plain text or rich text. Otherwise, outputs False.
IsBlank(value)
Copy linkCheck if a value is blank
IsBlank("")
IsBlank("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is blank. Otherwise, outputs False.
IsDate(value)
Copy linkChecks if a value is a date
IsDate("2014-01-1")
IsDate("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is a date. Otherwise, outputs False.
IsLogical(value)
Copy linkChecks if a value is true or false
IsLogical(True)
IsLogical("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is True or False. Outputs False if it's neither.
IsNotBlank(value)
Copy linkChecks if a value is not blank
IsNotBlank("")
IsNotBlank("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is not blank. Otherwise, outputs False.
IsNotText(value)
Copy linkChecks if a value is not text
IsNotText(14)
IsNotText("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is not blank. Otherwise, outputs False.
IsNumber(value)
Copy linkChecks if a value is a number
IsNumber(14)
IsNumber("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is a number. Otherwise, outputs False.
IsPlainText(value)
Copy linkChecks if a value is plain text
IsPlainText("Hello world")
IsPlainText(14)
Inputs
- value
- A value to check
Output
Outputs True if the given value is plain text. Otherwise, outputs False. Will output False if value is rich text.
IsRichText(value)
Copy linkChecks if a value is rich text
IsRichText(BulletedList(List("Hello", "world")))
IsRichText("Hello world")
Inputs
- value
- A value to check
Output
Outputs True if the given value is rich text. Otherwise, outputs False. Will output False if value is plain text.
ToNumber(value, base)
Copy linkConvert a value to a number
ToNumber("134")
ToNumber("FF", 16)
Required inputs
- value
- A value to convert
Optional inputs
- base
- The base or radix used to parse value. Defaults to 10.
Output
Outputs value as a number if conversion with base is possible. Otherwise outputs value.
ToText(value)
Copy linkConvert a value to text
ToText(11431)
Inputs
- value
- A value to convert
Output
Outputs value as text.
Lists
All(list, expression)
Copy linkChecks if an expression evaluates to true for all values in a list
List(1, 2, 3).All(CurrentValue > 2)
[Table 1].Status.All(CurrentValue = "Is Done")
Required inputs
- list
- A table, column, or list of values
Optional inputs
- expression
- A formula returning a boolean value (true or false). Defaults to `CurrentValue`.
Output
Outputs True if the result for evaluating expression on every value in list is true.
Any(list, expression)
Copy linkChecks if an expression evaluates to true for any value in a list
List(1, 2, 3).Any(CurrentValue > 2)
[Table 1].Owner.Any(CurrentValue = User())
Required inputs
- list
- A table, column, or list of values
Optional inputs
- expression
- A formula returning a boolean value (true or false). Defaults to `CurrentValue`.
Output
Outputs True if the result for evaluating expression on any value in list is true.
Contains(value, search)
Copy linkChecks if a list contains any value from a list
Contains("Dog", "Cat", "Mouse")
Contains("Dog", "Cat", "Mouse", "Dog")
List("Dog", "Giraffe").Contains("Cat", "Mouse", "Dog")
Inputs
- value
- A value or list of values to search in
- search...
- A value or list of values to search for
Output
Outputs True if any value in search exists in value.
ContainsAll(value, search)
Copy linkChecks if a list contains all values from a list
ContainsAll("Dog", "Cat", "Mouse")
ContainsAll(List("Cat", "Rabbit"), "Cat", "Mouse")
List("Cat", "Mouse", "Rabbit").ContainsAll(List("Cat", "Mouse"))
Inputs
- value
- A value or list of values to search in
- search...
- A value or list of values to search for
Output
Outputs True if all values in search exists in value.
ContainsOnly(value, search)
Copy linkChecks if a list contains only values from a list
ContainsOnly("Dog", List("Dog", "Mouse"))
List("Dog", "Mouse", "Cat").ContainsOnly("Cat", "Mouse")
List("Dog", "Mouse").ContainsOnly("Mouse", "Dog")
ContainsOnly(List("Dog", "Dog"), "Dog")
Inputs
- value
- A value or list of values to search in
- search...
- A value or list of values to search for
Output
Outputs True if only values in search exist in value.
CountAll(list)
Copy linkCounts the size of a list including blank values
Planets.CountAll()
List("a", "b", "").CountAll()
Inputs
- list
- A table, column, or list of values
Output
Outputs the count of values in list, including blank values.
Duplicates(value)
Copy linkGet duplicate values
List("Dog", "Dog", "Cat", "Mouse", "Cat").Duplicates()
List(1, 2, 3).Duplicates()
Inputs
- value...
- A value to check for duplication
Output
Outputs a list of values which appear multiple times.
First(list)
Copy linkGet the first value from a list
List(1, 3, 5, 7, 11, 13).First()
Inputs
- list
- A table, column, or list of values
Output
Outputs the first value in list or blank if the list is empty.
ForEach(list, formula)
Copy linkRun a formula for every item in a list
List("Dog", "Cat").ForEach(Upper(CurrentValue))
Inputs
- list
- A table, column, or list of values
- formula
- A formula to evaluate for each item. Can reference CurrentValue.
Output
Evaluates formula for every value in list and outputs a list of all formula outputs.
FormulaMap(list, formula)
Copy linkRun a formula for every item in a list
List("Dog", "Cat").FormulaMap(Upper(CurrentValue))
Inputs
- list
- A table, column, or list of values
- formula
- A formula to evaluate for each item. Can reference CurrentValue.
Output
Evaluates formula for every value in list and outputs a list of all formula outputs.
In(search, value)
Copy linkChecks if a value is in a list
In("Dog", "Cat", "Mouse")
In("Dog", "Cat", "Mouse", "Dog")
Inputs
- search
- A value to search for
- value...
- A value or list of values to search in
Output
Outputs True if search is found in value.
Last(list)
Copy linkGet the last value from a list
List(1, 3, 5, 7, 11, 13).Last()
Inputs
- list
- A table, column, or list of values
Output
Outputs the last value in list or blank if the list is empty.
List(value)
Copy linkMake a list of values
List(1, 3, 5, 7, 11, 13)
List("Dog", "Cat", "Mouse").NTH(2)
Inputs
- value...
- A value or list of values to include in the list
Output
Outputs a list of value(s) or an empty list if no value is provided.
ListCombine(value)
Copy linkMerge and flatten lists
ListCombine(List(1, 2, 3), 4, 5, 6)
ListCombine(List(1, 2, 3), List(4, 5), 6)
Inputs
- value...
- A value or list of values to include in the combined list
Output
Outputs a list of all value(s). Nested lists are flattened in the output.
Nth(list, position)
Copy linkReturns the nth item in a list from the number provided
List(1,3,5,7,11).Nth(1)
List("Dog", "Cat", "Mouse").Nth(3)
Inputs
- list
- A table, column, or list of values
- position
- The position to retrieve a value for. The first item in the list has index 1.
Output
Outputs the value from list at position. Results in an error if position is outside of list.
RandomItem(list, updateContinuously)
Copy linkSelect a random item from a list
RandomItem(List(1,2,3))
Required inputs
- list
- A table, column, or list of values
Optional inputs
- updateContinuously
- If True the output will change on every doc edit. Otherwise, the number will only be generated once. Defaults to True.
Output
Outputs a random item from list. Regenerates on every edit by default.
RandomSample(list, count, withReplacement, updateContinuously)
Copy linkGenerate a random sample of items from a list
RandomSample(Sequence(1, 10), 3)
RandomSample(Sequence(1, 10), 5, True)
Required inputs
- list
- A table, column, or list of values
- count
- The number of items to sample
Optional inputs
- withReplacement
- Whether to sample with replacement, where items can appear multiple times in the sample. Defaults to false.
- updateContinuously
- If True the output will change on every doc edit. Otherwise, the number will only be generated once. Defaults to True.
Output
Outputs a random sample of count items from list. By default, samples without replacement and regenerates on every edit.
ReverseList(list)
Copy linkReverse the values in a list
List(1, 5, 3, 7, 2).ReverseList()
Inputs
- list
- A table, column, or list of values
Output
Returns list reversed.
Sequence(start, end, by)
Copy linkReturns a list of numbers between the provided from and to parameters
Sequence(1, 10)
Sequence(0, 50, 10)
Required inputs
- start
- The number to start from
- end
- The number to end at
Optional inputs
- by
- The increment or step between numbers in the sequence. Defaults to 1 or -1 depending on start and end
Output
Outputs a list of numbers from start to end. Step size is controlled via the by input.
Unique(value)
Copy linkDeduplicate values
List("Dog", "Dog", "Cat", "Mouse").Unique()
List(1, 2, 3).Unique()
Inputs
- value...
- A value to deduplicate
Output
Outputs a list of unique value(s). Deduplicates against each item in a value if it is a list.
Logical
And(value)
Copy linkReturns true if all the items are true, otherwise false
And(Today() > Date(2015, 4, 23), Bugs.Count() < 5)
And(True(), True())
And(True(), False())
Inputs
- value...
- A value to check
Output
Outputs True if all value(s) are true. Otherwise returns False.
If(condition, ifTrue, ifFalse)
Copy linkGet a value conditionally (single condition)
If(Today() > Date(2015, 4, 23), "Hello world", "Not true")
If(Today() < Date(2015, 4, 23), "Hello world", "Not true")
Inputs
- condition
- An expression that outputs true or false
- ifTrue
- A value to output if condition is true
- ifFalse
- A value to output if condition is false
Output
Outputs ifTrue if the condition is true. Otherwise outputs ifFalse.
IfBlank(value, ifBlank)
Copy linkGet a value with fallback if blank
IfBlank("Hello world", "Alternate text")
IfBlank("", "Alternate text")
Inputs
- value
- The value to return if not blank
- ifBlank
- The value outputted if valueis blank
Output
Outputs ifBlank if value is blank. Otherwise outputs value.
Not(value)
Copy linkNegate a true or false value
True().Not()
Not(False())
Inputs
- value
- A value to negate
Output
Outputs True if valueis false and False if value is true.
Or(value)
Copy linkCheck if any input is true
Or(Today() > Date(2015, 4, 23), Bugs.Count() < 5)
Or(True(), False())
Or(False(), False())
Inputs
- value...
- A value to check
Output
Outputs True if any value is true. Otherwise outputs False.
Switch(expression, value, result, arg)
Copy linkGet a value conditionally. Handles multiple conditions
Switch(Year(Today()), 2024, "The past", 2025, "The now", 2026, "The future")
Switch("In progress", "Done", 10, "Open", 1, 5)
Inputs
- expression
- A value or expression to check
- value
- Check if this matches expression
- result
- If value matches expression output this value
- arg...
- Any number of value and result pairs followed by an optional default value
Output
Outputs the first result where value matches expression. Outputs an optional final value if no value matches.
SwitchIf(condition, ifTrue, arg)
Copy linkGet a value conditionally. Handles multiple conditions with a fallback
SwitchIf(Today() > Date(2100, 1, 20), "Hello future!", Year(Today()) >= 2000, "Hello present!", "Hello past!")
Inputs
- condition
- A formula that ouputs true or false
- ifTrue
- A value to output if condition is true
- arg...
- Any number of condition and ifTrue pairs followed by an optional default value
Output
Outputs the first ifTrue value where condition is true. Outputs the an optional final value if no condition is true.
Math
AbsoluteValue(number)
Copy linkGet the absolute value of a number
AbsoluteValue(-14)
AbsoluteValue(123)
Inputs
- number
- A number
Output
Outputs number without the sign, so negative numbers become positive in the output.
Average(value)
Copy linkAverages a list of numbers ignoring any blank values
Planets.[Number of moons].Average()
Average(1, 3, 5, 7)
Inputs
- value...
- A numeric value or list of numeric values
Output
Outputs the average value. Blank values are ignored. All items in value are averaged if value is a list.
BinomialCoefficient(n, k)
Copy linkCalculates the Binomial Coefficient
BinomialCoefficient(6, 2)
Inputs
- n
- The number of possibilities to choose from. Any non-negative integer
- k
- The number of items to choose. Any non-negative integer less than or equal to n
Output
Outputs the number of ways to choose k items out of n possibilities. In math, the symbols nCk and (n k) can denote a bionmial coefficient, and are sometimes read as "n choose k".
Ceiling(value, factor)
Copy linkRounds a number up to the nearest multiple
Ceiling(3.14, 0.1)
Ceiling(7, 3)
Required inputs
- value
- A number to round up
Optional inputs
- factor
- A number multiple that value should round up to. Defaults to 1
Output
Outputs value rounded up to the nearest multiple of factor.
Even(value)
Copy linkRounds a number up to the nearest even number
Even(3)
Even(2.33)
Inputs
- value
- A number to round
Output
Outputs value rounded up to the nearest even number.
Exponent(value)
Copy linkReturns Euler's number e (~2.718) raised to a power
Exponent(2)
Inputs
- value
- A number
Output
Outputs Euler's number for value e (~2.718) raised to a power.
Factorial(value)
Copy linkCalculates the product of an integer and all the integers below it
Factorial(4)
Inputs
- value
- An integer number
Output
Outputs the product of an integer value and all the integers below it. If the number if a decimal will only use the initial integer. Note: Inputs greater than 19 may cause precision errors.
Floor(value, factor)
Copy linkRounds a number down to the nearest multiple
Floor(3.14, 0.1)
Floor(7, 3)
Required inputs
- value
- A number to round down
Optional inputs
- factor
- A number multiple that value should round up to. Defaults to 1
Output
Outputs value rounded down to the nearest multiple of factor.
IsEven(value)
Copy linkChecks if a value is even
IsEven(17)
IsEven(6)
Inputs
- value
- A value to check
Output
Outputs True if value is even. Otherwise returns False.
IsOdd(value)
Copy linkChecks if a value is odd
IsOdd(17)
IsOdd(6)
Inputs
- value
- A value to check
Output
Outputs True if value is odd. Otherwise returns False.
Ln(number)
Copy linkGet the natural logarithm of a number. (Base e)
Ln(100)
Inputs
- number
- A number
Output
Outputs the logarithm of number, base e (Euler's number).
Log(number, base)
Copy linkGet the logarithm of a number for a given base
Log(128, 2)
Inputs
- number
- A number
- base
- Logarithm base to use
Output
Outputs the logarithm of number to base.
Log10(number)
Copy linkGet the logarithm of a number (base 10)
Log10(100)
Inputs
- number
- A number
Output
Get the logarithm of number (base 10).
Max(value)
Copy linkGet the maximum number or date/time
Max(1, 3, 5, 7, 11)
Inputs
- value...
- A numeric value or list of numeric values
Output
Outputs the maximum value. Blank values are ignored. Checks all items in value if value is a list. Use MaxBy instead to get the maximum value by a specific criteria.
Median(value)
Copy linkGet the median number or date/time
Median(1, 3, 5, 7, 11)
Inputs
- value...
- A numeric value or list of numeric values
Output
Outputs the median value. Blank values are ignored. Checks all items in value if value is a list.
Min(value)
Copy linkGets the minimum number or date/time
Min(1, 3, 5, 7, 11)
Inputs
- value...
- A numeric value or list of numeric values
Output
Outputs the minimum value. Blank values are ignored. Checks all items in value if value is a list. Use MinBy instead to get the minimum value by a specific criteria.
Mode(value)
Copy linkGet the most common value
Mode(1, 3, 3, 3, 5, 7)
Inputs
- value...
- A value or list of values
Output
Outputs the mode (most frequently occurring) value. Blank values are ignored. Checks all items in value if value is a list.
Odd(value)
Copy linkRounds a number up to the nearest odd number
Odd(2)
Odd(1.23)
Inputs
- value
- A number to round
Output
Outputs value rounded up to the nearest odd number.
Percentile(dataset, percentile)
Copy linkGet the value at a given percentile of a dataset
Percentile(List(10, 22, 7, 2, 5), 0.5)
Percentile(List(4, 2, 10, 6, 8, 12), 0.1)
Inputs
- dataset
- A list of numbers
- percentile
- The percentile from dataset to return
Output
Outputs the interpolated value at the given percentile within dataset.
PercentileRank(dataset, value)
Copy linkGet percentile rank of a value in a dataset
PercentileRank(List(10, 22, 7, 2, 5), 7)
PercentileRank(List(4, 2, 10, 6, 8, 12), 12)
Inputs
- dataset
- A list of numbers
- value
- The value to find within dataset
Output
Outputs the percentile rank of value within dataset.
Power(number, exponent)
Copy linkCalculates a number raised to a power
Power(2, 3)
Power(10, 2)
Inputs
- number
- A number to be raised to a power
- exponent
- The power to raise number by
Output
Outputs number raised to exponent.
Product(value)
Copy linkMultiplies numbers together
Product(3, 5, 2)
Inputs
- value...
- A number of list of numbers to multiply
Output
Outputs the mathematical product of all values. Blank values are ignored. Multiplies all items in value if value is a list.
Quotient(dividend, divisor)
Copy linkDivide one number by another
Quotient(10, 5)
Inputs
- dividend
- A number to divide
- divisor
- A number to divide dividend by
Output
Outputs dividend divided by divisor.
Random(updateContinuously)
Copy linkGenerate a random number
Random()
Optional inputs
- updateContinuously
- If True the output will change on every doc edit. Otherwise, the number will only be generated once. Defaults to True.
Output
Outputs a random number between 0 and 1 (including 0, excluding 1). Regenerates on every edit by default.
RandomInteger(low, high, updateContinuously)
Copy linkGenerate a random number between two values
RandomInteger(1,10)
Required inputs
- low
- The smallest number that can be generated
- high
- The largest number that can be generated
Optional inputs
- updateContinuously
- If True the output will change on every doc edit. Otherwise, the number will only be generated once. Defaults to True.
Output
Outputs a random number between low and high.
Rank(value, dataset, ascending)
Copy linkReturns the ordered position of a value in a list
Rank(12, List(10, 15, 12, 3, 5, 1))
Required inputs
- value
- The value to rank
- dataset
- The list of numbers to sort and then search
Optional inputs
- ascending
- If true dataset will be sorted in ascending order, else descending. Defaults to false.
Output
Outputs the position of a value within dataset when sorted.
Remainder(dividend, divisor)
Copy linkGets the remainder from dividing two numbers
Remainder(7, 3)
Remainder(17, 5)
Inputs
- dividend
- A number of divide
- divisor
- A number to divide dividend by
Output
Outputs the remainder when dividend is divided by divisor.
Round(number, places)
Copy linkRound a number
Round(3.14159, 2)
Round(48.111, 0)
Required inputs
- number
- A number to round
Optional inputs
- places
- The number of decimal places to round to
Output
Outputs number rounded to the specific number of decimal places.
RoundDown(number, places)
Copy linkRound a number down
RoundDown(3.14159, 3)
RoundDown($48.999, 0)
Required inputs
- number
- A number to round
Optional inputs
- places
- The number of decimal places to round to
Output
Outputs number rounded down to the specified number of decimal places.
RoundTo(value, factor)
Copy linkRounds one number to the nearest integer multiple of another
RoundTo(22, 14)
RoundTo(8, 5)
Inputs
- value
- A number to round
- factor
- A numeric multiple that value should round to
Output
Outputs value rounded to the nearest multiple of factor. If no factor is specified rounds to the nearest integer.
RoundUp(number, places)
Copy linkRound a number up
RoundUp(3.14159, 2)
RoundUp($48.01, 0)
Required inputs
- number
- A number to round
Optional inputs
- places
- The number of decimal places to round to
Output
Outputs number rounded up to the specified number of decimal places.
Sign(number)
Copy linkGet the sign of a number
Sign(13)
Sign(-4)
Inputs
- number
- A number
Output
Outputs -1 if number is negative, 0 if number is zero, or 1 if number is positive.
SquareRoot(number)
Copy linkCalculates the square root of a number
SquareRoot(64)
Inputs
- number
- A number
Output
Outputs the square root of number.
StandardDeviation(value)
Copy linkEstimates the standard deviation of a population based on a sample of values
StandardDeviation(1, 3, 5, 7, 11)
Inputs
- value...
- A number or list of numbers
Output
Outputs the estimated standard deviation based on the sample in values. Blank values are ignored. All items in value are considered if value is a list.
StandardDeviationPopulation(value)
Copy linkCalculates the standard deviation based on an entire population
StandardDeviationPopulation(1, 3, 5, 7, 11)
Inputs
- value...
- A number or list of numbers
Output
Outputs the standard deviation based on values that make up the entire population. Blank values are ignored. All items in value are considered if value is a list.
Sum(value)
Copy linkAdds numbers together
Sum(1, 2, 3, 4)
Inputs
- value...
- A number or list of numbers to sum
Output
Outputs the mathematical sum of all values. Blank values are ignored. Sum all items in value if value is a list.
SumProduct(list1, list2)
Copy linkCalculates the total from multiplying two lists
SumProduct(List(1, 2), List(3, 4))
Inputs
- list1
- A list of numbers
- list2
- An equally sized list of numbers
Output
Outputs the total sum of the products of list1 and list2. Each list must be of equal size.
Truncate(number, places)
Copy linkTruncates a number
Truncate(3.14159, 4)
Required inputs
- number
- A number
Optional inputs
- places
- The number of decimal places to truncate at
Output
Outputs number truncated to places.
Misc
DocId(url)
Copy linkGets the document ID from a Coda doc URL.
DocId("https://coda.io/d/My-Doc_dAbCdEfGhIj")
Inputs
- url
- A Coda URL
Output
Outputs the document ID from the given url.
ObjectLink(object, displayText)
Copy linkGet the url for an object
thisDocument.ObjectLink()
Required inputs
- object
- A Coda object. This includes tables, views, rows, and docs.
Optional inputs
- displayText
- Display Text to give to the URL object.
Output
Outputs a URL for object.
PageName(object)
Copy linkGet the name of the page an object belongs to
thisTable.PageName()
Inputs
- object
- A Coda object. This includes pages, tables, views, controls, and canvas formulas.
Output
Outputs the name of the page that object belongs to.
ParseCSV(csvString, delimiter)
Copy linkConverts a CSV to list
ParseCSV("Hello,World,!", ",")
ParseCSV("I'm a TSV", Character(9))
Required inputs
- csvString
- A delimited string value.
Optional inputs
- delimiter
- The delimiter to use. Defaults to ","
Output
Outputs a list of items by parsing a csvString delimited by a delimiter. The delimiter can be changed to work with other formats like TSV. You can also use our CSV importer for one-off imports.
SwapDocIdInUrl(url, docId)
Copy linkUpdates a Coda doc URL to point to a new doc id.
SwapDocIdInUrl("https://coda.io/d/My-Doc_dABCDEFG", "1234567")
Inputs
- url
- A Coda URL
- docId
- The new document ID
Output
Outputs the updated URL.
Object
ParseJSON(jsonString, path)
Copy linkParses a JSON string
ParseJSON('{"name": "Mike", "location": "New York"}', "$.name")
Required inputs
- jsonString
- A JSON string. For example: '{"name": "Bob", "age": 42}'
Optional inputs
- path
- A path within the JSON; for example, "$.pull_request.state".See https://goessner.net/articles/JsonPath/ for details.
Output
Outputs the value parsed from jsonString at path. If path is not specified, outputs the entire parsed value.
People
CreatedBy(object)
Copy linkGet the creator for a row or other object
thisRow.CreatedBy()
Inputs
- object
- A Coda object. This includes tables, views, columns, rows, and docs.
Output
Outputs the user who created object.
IsSignedIn()
Copy linkChecks if the current user is logged in
Output
Outputs True if the current user is logged in. Otherwise, outputs False.
ModifiedBy(object)
Copy linkReturns the user who modified the previous item
thisRow.ModifiedBy()
Inputs
- object
- A Coda object. This includes tables, views, columns, rows, and docs.
Output
Outputs the user who modified object most recently.
User()
Copy linkGet the current logged in user
User()
Output
Outputs the current user. Will be different for every user. Note: * User().email returns the current user emails * User().name returns the current users name *User().photo returns the current users photo *User().state returns the current users doc access (e.g. write access).
Relational
Let(value, name, expression)
Copy linkNames a value so you can refer to it inside an expression. Useful if you want to use a value multiple times (i.e., as a local variable) or give it a clearer name. If you have a nested formula with an inner and outer CurrentValue, you can give each of them distinct names
Let(Tasks.Count(), n, If(n > 0, n, "Done!"))
List(1, 2, 3, 4).Filter(CurrentValue.Let(n, n > 1 and n < 4))
Inputs
- value
- The value you want to rename
- name
- A shorter name you can use to refer to value. Enter the name without quotes
- expression
- Any formula. Inside this formula, you can use name to reference value
Output
Outputs the result of expression.
RowId(row)
Copy linkA unique ID for a row
thisRow.RowId()
Inputs
- row
- A row in a table
Output
Outputs a unique ID for row.
WithName(value, name, expression)
Copy linkNames a value so you can refer to it inside an expression. Useful if you want to use a value multiple times (i.e., as a local variable) or give it a clearer name. If you have a nested formula with an inner and outer CurrentValue, you can give each of them distinct names
WithName(Tasks.Count(), n, If(n > 0, n, "Done!"))
List(1, 2, 3, 4).Filter(CurrentValue.WithName(n, n > 1 and n < 4))
Inputs
- value
- The value you want to rename
- name
- A shorter name you can use to refer to value. Enter the name without quotes
- expression
- Any formula. Inside this formula, you can use name to reference value
Output
Outputs the result of expression.
RichText
BulletedList(value)
Copy linkCreate a bulleted list of values
BulletedList("Dog", "Cat", "Mouse")
Inputs
- value...
- A value or list of values
Output
Outputs a bulleted list of given value(s).
IndentBy(text, levels)
Copy linkChange the relative indent of content
IndentBy("Foo", 1)
Inputs
- text
- A text value
- levels
- The number of levels to indent by. Can be positive or negative.
Output
Outputs text with indent adjusted by levels.
NumberedList(value)
Copy linkCreate a numbered list of values
NumberedList("Dog", "Cat", "Mouse")
Inputs
- value...
- A value or list of values
Output
Outputs a numbered list of given value(s).
Shape
ClipCircle(image)
Copy linkCrops an image into a circle
ClipCircle(Image("https://pbs.twimg.com/profile_images/671865418701606912/HECw8AzK.jpg"))
Inputs
- image
- An image to crop
Output
Outputs a cropped circular image.
Embed(url, width, height, force)
Copy linkGet an HTML embed for a URL
Embed("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Embed("https://www.theverge.com/2017/10/19/16497444/coda-spreadsheet-krypton-shishir-mehrotra", 400, 500)
Required inputs
- url
- The URL or web address to display
Optional inputs
- width
- How wide to render the embed. Use 0 for default.
- height
- How tall to render the embed. Use 0 for default.
- force
- Load the URL directly in your browser using compatibility mode. Used for pages with sign ins.
Output
Outputs an HTML embed for url with the specified width and height.
Hyperlink(url, displayValue)
Copy linkCreate a link
Hyperlink("www.google.com", "Google")
Required inputs
- url
- The URL or web address to link to
Optional inputs
- displayValue
- The text to show
Output
Outputs a link that shows the given displayValue and navigates to url.
HyperlinkCard(url)
Copy linkCreates rich url card
HyperlinkCard("cnn.com")
Inputs
- url
- The URL or web address to display
Output
Outputs a card for the given url.
Image(url, width, height, name, style, outline)
Copy linkGets an image for a URL
Image("https://pbs.twimg.com/profile_images/671865418701606912/HECw8AzK.jpg")
Required inputs
- url
- The URL of an image. Includes GIF, PNG, and JPG
Optional inputs
- width
- How wide to render the image. Use 0 for default.
- height
- How tall to render the image. Use 0 for default.
- name
- Alternative text of the image
- style
- One of auto or circle
- outline
- Whether or not to render outline around image. Defaults to true.
Output
Outputs an image for url with the specified width, height, name, style, and outline.
Rectangle(width, height, color, name)
Copy linkGenerates a rectangle
Rectangle(200, 20, "#007AF5")
Required inputs
- width
- How wide to render the rectangle.
Optional inputs
- height
- How tall to render the rectangle. Use 0 for default.
- color
- Color as RGB hex #RRGGBB (black if omitted)
- name
- Alternative text of the image
Output
Outputs a rectangle with specified width, height, color, and name.
Spatial
Distance(location1, location2, unit)
Copy linkReturns the distance (in kilometers) between two locations (lat/long) on earth using the Haversine formula
Distance(Location(33.9206418,-118.3303341), Location(37.4274787, -122.1719077))
Required inputs
- location1
- Coordinates of lat and long. Use Location()
- location2
- Coordinates of lat and long. Use Location()
Optional inputs
- unit
- "M"iles, "N"autical miles or "K"ilometers. Defaults to "K"ilometers if not specified
Output
Outputs the distance in specified unit between location1 and location2 using the Haversine formula.
Location(latitude, longitude, altitude, heading, speed, accuracy, altitudeAccuracy)
Copy linkGet location for the provided lat-long
Location(33.9206418,-118.3303341)
Required inputs
- latitude
- Position in decimal degrees
- longitude
- Position in decimal degrees
Optional inputs
- altitude
- Altitude relative to sea level
- heading
- Direction of travel in degrees
- speed
- Meters per second
- accuracy
- accuracy of latitude and longitude in meters
- altitudeAccuracy
- accuracy of altitude in meters
Output
Outputs a single location object using latitude and longitude. Can also optionally include altitude, heading, speed, accuracy, and altitudeAccuracy. Useful with Distance().
String
Character(charNumber)
Copy linkCreate a unicode character (symbol)
Concatenate(Character(191), "Que Pasa?")
Concatenate(Character(34), "Keep me in quotes", Char(34))
Inputs
- charNumber
- A number that matches a unicode value
Output
Outputs a single unicode character matching the charNumber given. https://en.wikipedia.org/wiki/List_of_Unicode_characters.
Concatenate(text)
Copy linkCombine multiple text values
Concatenate("Notes for", Today())
Inputs
- text...
- Any text value. Includes text, numbers, and dates
Output
Outputs the combined text of all text values as a single text value.
ContainsText(text, searchText, ignoreCase, ignoreAccents, ignorePunctuation)
Copy linkCheck if one text contains another.
ContainsText("a needle in the haystack", "needle")
ContainsText("Trippers and askers surround me", "trip")
ContainsText("But they are not the Me myself", "me", true)
ContainsText("crème fraîche", "creme", false, true)
Required inputs
- text
- The text value to search in.
- searchText
- A text value to search for.
Optional inputs
- ignoreCase
- Whether to ignore case when searching. Defaults to false.
- ignoreAccents
- Whether to ignore diacritics (accents, umlauts, cedillas, etc.) when checking. Defaults to false.
- ignorePunctuation
- Whether to ignore punctuation when (quotes, commas, periods, etc.) when searching. Defaults to false.
Output
Outputs True if text contains searchText.
DecodeFromBase64(base64Text)
Copy linkDecodes base64 encoded text
DecodeFromBase64("VGhlIHF1aWNrIC8gQnJvd24gZm94Pw")
Inputs
- base64Text
- The base64 encoded text
Output
Outputs base64Text as a string.
EncodeAsBase64(text)
Copy linkEncodes text as base64
EncodeAsBase64("The quick / Brown fox?")
Inputs
- text
- The text to base64 encode
Output
Outputs text base64 encoded.
EncodeForUrl(text)
Copy linkEncodes text use in a URL
EncodeForUrl("The quick / Brown fox?")
Inputs
- text
- The text to encode
Output
Outputs text formatted so it can be used in the query string of a URL.
EndsWith(text, suffix, ignoreCase, ignoreAccents)
Copy linkCheck if text ends with a suffix
EndsWith("Hello world", "Find me")
EndsWith("Hello world", "world")
EndsWith("Hello World", "world", true)
EndsWith("Hej världen", "varlden", false, true)
Required inputs
- text
- The text to check
- suffix
- The ending sub-text to check for
Optional inputs
- ignoreCase
- Whether to ignore case when checking. Defaults to false.
- ignoreAccents
- Whether to ignore diacritics (accents, umlauts, cedillas, etc.) when checking. Defaults to false.
Output
Outputs True if text ends with suffix. Otherwise outputs False.
Format(template, text)
Copy linkSubstitute values into a text template
Format("This is my {1} and it is {2}", "doc", "great")
Format("{1:0000}-{2:00}-{3:00}", Today().Year(), Today().Month(), Today().Day())
Inputs
- template
- A text value. To substitute a value, use {X} or {X:Y}. X is the nth argument after the format string. The Y part is optional. It determines how to pad the string if the value is not as long as Y.
- text...
- The text to insert at {X}. The first will insert at {1}, the second at {2} and so on
Output
Outputs text with all {X} values in template replaced with the matching text.
Join(delimiter, text)
Copy linkCombine multiple text values with a delimiter
Join("-", "This", "is", "Awesome")
Inputs
- delimiter
- A text value to use as a delimiter
- text...
- Text or list of text values
Output
Outputs text combining all text(s) with delimiter in-between every item.
Left(text, numberOfCharacters)
Copy linkExtract starting characters from text
Left("Hello world", 3)
Inputs
- text
- The text to extract a prefix from
- numberOfCharacters
- The number of characters to output
Output
Outputs the starting numberOfCharacters from text.
LeftPad(text, targetLength, padString)
Copy linkPad text from the left
LeftPad("10", 3)
LeftPad("99", 5, "0")
LeftPad("foo", 1)
Required inputs
- text
- The value to pad the start of
- targetLength
- The length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is.
Optional inputs
- padString
- The text to pad text with. Defaults to " " (space)
Output
Outputs text padded with padString at the start so that the resulting text has the given targetLength.
Length(text)
Copy linkReturns length of the given text
Length("Hello world")
Inputs
- text
- A text value
Output
Outputs the number of characters in text.
LineBreak(softLineBreak)
Copy linkReturns a line break
Concatenate("First", LineBreak(), "Second")
Optional inputs
- softLineBreak
- Whether to create a soft line break without additional spacing. Defaults to false.
Output
Outputs a line break.
Lower(text)
Copy linkConvert text to lower case
Lower("Hello WORLD")
Inputs
- text
- A text value
Output
Outputs text with all characters made lower case.
Middle(text, start, numberOfCharacters)
Copy linkExtract characters from the middle of text
Middle("Hello world", 3, 5)
Inputs
- text
- A text value
- start
- The character position to start from. Starts at 1
- numberOfCharacters
- The number of characters to extract
Output
Outputs numberOfCharacters from text starting at position.
RegexExtract(text, regularExpression, regexFlags)
Copy linkReturn the parts of text that match a regular expression
Required inputs
- text
- A text value
- regularExpression
- A Javascript regular expression. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Using_special_characters for documentation and test expressions at https://www.regextester.com
Optional inputs
- regexFlags
- Flags to use with regularExpression. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags_2
Output
Outputs the portions of text that match regularExpression
RegexMatch(text, regularExpression)
Copy linkCheck if text matches a regular expression
RegexMatch("Top Floor Pacific Heights Flat w/Parking (marina / cow hollow) $1200 1bd 800ft", "([$]\d+)")
Inputs
- text
- A text value
- regularExpression
- A Javascript regular expression. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Using_special_characters for documentation and test expressions at https://www.regextester.com
Output
Outputs True if text matches regularExpression.
RegexReplace(text, regularExpression, replacementText)
Copy linkSubstitute regular expression matches
RegexReplace("Top Flat w/Parking (marina / cow hollow) $1200 1bd 800ft", "([$]\d+)", "$2000")
Inputs
- text
- A text value
- regularExpression
- A Javascript regular expression. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Using_special_characters for documentation and test expressions at https://www.regextester.com
- replacementText
- Text to substitute
Output
Outputs text with all regularExpression matches replaced with replacementText.
Repeat(text, repetitions)
Copy linkRepeats text multiple times
Repeat("ha", 4)
Inputs
- text
- The text to repeat
- repetitions
- How many times to repeat text
Output
Outputs text based on repeating text by the number of repetitions specified.
Replace(text, start, numberOfCharacters, replacementText)
Copy linkReplace a range within text
Replace("Spreadsheets", 1, 6, "Bed")
Inputs
- text
- A text value
- start
- The character position to start from. Starts at 1
- numberOfCharacters
- The number of characters to remove
- replacementText
- Text to substitute
Output
Outputs text with numberOfCharacters removed starting at and replaced with replacementText.
Right(text, numberOfCharacters)
Copy linkExtract ending characters from text
Right("Hello world", 3)
Inputs
- text
- The text to extract a suffix from
- numberOfCharacters
- The number of characters to output
Output
Outputs ending characters of text.
RightPad(text, targetLength, padText)
Copy linkPad text from the right
RightPad("10", 3)
RightPad("99", 5, "0")
RightPad("foo", 1)
Required inputs
- text
- The value to pad the start of
- targetLength
- The length of the resulting text once text has been padded. If the value is lower than the current text's length, then text will be returned as is.
Optional inputs
- padText
- The string to pad text with. Defaults to " " (space)
Output
Outputs text padded with padText at the end so that the resulting text has the given targetLength.
Split(text, delimiter)
Copy linkSplit text on a delimiter
Split("I-need-these-apart-3/10/2017", "-")
Inputs
- text
- A text value to split up
- delimiter
- The character to split on. Use LineBreak() to split each line
Output
Outputs a list generated from splitting text by the delimiter character.
StartsWith(text, prefix, ignoreCase, ignoreAccents)
Copy linkCheck if text starts with specified characters
StartsWith("Hello world", "Find me")
StartsWith("Hello world", "Hello")
StartsWith("Hello world", "hello", true)
StartsWith("Hej världen", "Hej var", false, true)
Required inputs
- text
- The text to check.
- prefix
- The prefix to check for.
Optional inputs
- ignoreCase
- Whether to ignore case when checking. Defaults to false.
- ignoreAccents
- Whether to ignore diacritics (accents, umlauts, cedillas, etc.) when checking. Defaults to false.
Output
Outputs True if text starts with prefix. Otherwise outputs False.
Substitute(text, searchFor, replacementText)
Copy linkReplace the first matching substring in some text
Substitute("Hello world", "Hello", "Good morning")
Substitute("ho ho ho", "ho", "yo")
Inputs
- text
- A text value
- searchFor
- The text value to search for
- replacementText
- Text to substitute
Output
Outputs text with the first searchFor match replaced with replacementText.
SubstituteAll(text, searchFor, replacementText)
Copy linkReplace all matching substrings in some text
SubstituteAll("The Cat in the Hat", "at", "orn")
Inputs
- text
- A text value
- searchFor
- The text value to search for
- replacementText
- Text to substitute
Output
Outputs text with all searchFor matches replaced with replacementText.
ToByteSize(byteCount, base)
Copy linkPretty-print a byte count (KB, MB, GB, etc.)
ToByteSize(265318)
ToByteSize(265318, 2)
Required inputs
- byteCount
- A number of bytes
Optional inputs
- base
- conversion base, 2 or 10 (default)
Output
Outputs a text rendering of byteCount (KB, MB, GB, etc.).
ToHexadecimal(decimalNumber, targetLength)
Copy linkConvert a number to a hexadecimal string
ToHexadecimal(10)
ToHexadecimal(10, 4)
Required inputs
- decimalNumber
- A decimal number
Optional inputs
- targetLength
- The target length
Output
Outputs a text of decimalNumber converted to hexadecimal. Left-pads result with 0's to satisfy targetLength if specified.
Trim(text)
Copy linkTrim starting and ending spaces from text
Trim(" loooking good! ")
Trim("Stay positive ")
Inputs
- text
- A text value
Output
Outputs text with all of the leading and trailing spaces removed.
Upper(text)
Copy linkConvert text to upper case
Upper("hello")
Inputs
- text
- A text value
Output
Outputs text with all characters made upper case.
Actions
Activate(object)
Copy linkPlaces the cursor on the given object
Activate(Tasks.first())
Inputs
- object
- A Coda object. This includes table, views, columns, rows, and docs
Output
Outputs an action which (when run) will place the cursor on object.
AddOrModifyRows(table, expression, column, columnValue)
Copy linkModify matching rows or add one if none match
AddOrModifyRows(Tasks, Status = "Open", Description, "Send out metrics")
Inputs
- table
- The table to modify
- expression
- Filter to rows you want to modify
- column...
- The column to populate
- columnValue...
- The value to set in column
Output
Outputs an action which (when run) will modify all rows in table matching expression with specified columnValue(s). If no rows match, will add a new row.
AddRow(table, column, columnValue)
Copy linkAdd a row to the table
AddRow(Tasks, Description, "Send out metrics")
Inputs
- table
- The table to modify
- column...
- The column to populate
- columnValue...
- The value to set in column
Output
Outputs an action which (when run) will add a new row to table and update the specified column(s) with columnValue(s).
CopyDoc(title, url, folder)
Copy linkCopy a document to your document list
CopyDoc()
CopyDoc('newTitle')
CopyDoc('newTitle', 'https://coda.io/d/My-Doc_dQw4t2TMcVQ/')
CopyDoc('newTitle', 'https://coda.io/d/My-Doc_dQw4t2TMcVQ/', 'fl-123345')
CopyDoc('newTitle', 'https://coda.io/d/My-Doc_dQw4t2TMcVQ/', 'https://coda.io/folders/fl-123345')
CopyDoc('newTitle', 'fl-123345')
CopyDoc('newTitle', 'https://coda.io/folders/fl-123345')
Optional inputs
- title
- The title of the new doc (optional).
- url
- The url of the doc to copy (optional)
- folder
- The id or url of the folder to copy the doc to (optional)
Output
Outputs an action which (when run) will copy this or another document.
CopyPageToDoc(page)
Copy linkCopies the current page to a new doc or to another doc
CopyPageToDoc()
Optional inputs
- page
- The page that will be copied
Output
An action which when triggered will copy the current page.
CopyToClipboard(content)
Copy linkCopy content to your clipboard
CopyToClipboard("https://google.com")
Inputs
- content
- The content to copy to the clipboard
Output
Outputs an action which (when run) will copy content to your clipboard. Rich text formatting will not be preserved.
DeleteRows(rows)
Copy linkDeletes specified rows
DeleteRows(Tasks.filter(Status != "Done"))
Inputs
- rows
- A list of rows to delete
Output
Outputs an action which (when run) will delete each row in rows.
DuplicatePage(page, name, parentPage, copySubpages, duplicateOptions, rowOptions)
Copy linkDuplicates a page
DuplicatePage([Topic template], 'Launch discussions', [Parent page], true, 'CreateViews')
Required inputs
- page
- The page that will be duplicated.
Optional inputs
- name
- Name for the new page.
- parentPage
- The page to create the new page under. Defaults to the parent of page .
- copySubpages
- Whether to copy all subpages of page. Defaults to false.
- duplicateOptions
- Behavior when the page has tables and views. If set to "CreateViews", edits to data in the new page will show up in the original tables too. If set to "DuplicateData", edits to data in the new page won't affect the rest of your doc. If set to "DuplicateTables", edits to views in the new page will show up in the original table, and other edits won't affect the rest of your doc. Defaults to "CreateViews".
- rowOptions
- This parameter is used to specify which rows should be included. It should be one of - All, Visible, None. If set to `All`, all rows including those hidden by a view will be included. If set to `Visible`, only visible rows will be included. If set to `None`, none of the rows will be included. This option is only used if duplicateOptions is not "CreateViews".
Output
Outputs an action (when run) which will create a duplicate page of page with the given name.
DuplicateRows(rows, column, columnValue)
Copy linkDuplicates one or more rows
DuplicateRows(thisRow, Status, "Done")
Inputs
- rows
- The rows in a table to duplicate
- column...
- The column to modify
- columnValue...
- The value to set in column
Output
Outputs an action value which (when run) will duplicate the target rows and modify the specified column(s) with columnValue.
ModifyRows(rows, column, columnValue)
Copy linkModify values in one or more rows
ModifyRows(Tasks.filter(Status != "Done"), Status, "Done")
Inputs
- rows
- The rows in a table to modify
- column...
- The column to modify
- columnValue...
- The value to set in column
Output
Outputs an action value which (when run) will modify the specified column(s) with columnValue(s) for each row in rows.
NoAction()
Copy linkDoes nothing.
If(HasCheckedAgreement, CopyDoc(), NoAction())
Output
Outputs an action which (when run) does nothing.
Notify(people, message)
Copy linkNotify doc users
Notify([Owner], "Hey [Owner], can you update your status?"
Inputs
- people
- The person or list of people to notify
- message
- The message to send
Output
Outputs an action which (when run) will send message to people via an email and in-app notification.
OpenRow(row, viewOrLayout, viewMode)
Copy linkOpens the row
OpenRow(Tasks.first(), View, "Fullscreen")
Required inputs
- row
- The row to open
Optional inputs
- viewOrLayout
- The view to use to open the row
- viewMode
- The view mode to use for the opened row (modal, fullscreen, center, or right)
Output
Outputs an action which (when run) will open the row.
OpenWindow(url)
Copy linkOpen a link in a new tab
OpenWindow("https://www.google.com")
Inputs
- url
- The web address to open
Output
Outputs an action which (when run) will open url in a new browser tab.
RefreshAssistant(references)
Copy linkRefresh assistant related things
RefreshAssistant(AiBlock)
Inputs
- references...
- The column or block to refresh
Output
Outputs an action which (when run) refreshes assistant data in references(s).
RefreshColumn(column)
Copy linkRefresh Pack columns
Refresh(PR)
Inputs
- column...
- The column to refresh
Output
Outputs an action which (when run) refreshes Pack data in column(s).
RefreshTable(tableRef)
Copy linkRefreshes the given Pack table. This is not supported in automations.
RefreshTable(Events)
Inputs
- tableRef
- Pack table
Output
Outputs an action which (when run) queues up a sync of the given table. Subsequent actions may complete before the sync starts, but syncs in the queue are processed sequentially.
ResetControlValue(control)
Copy linkResets the value of a control
ResetControlValue(PersonalTextbox)
ResetControlValue(CollaborativeTextbox)
ResetControlValue(CollaborativeCheckbox)
Inputs
- control
- The control to reset
Output
Outputs an action value which (when run) will reset the value of control.
RunActions(action)
Copy linkRun one or more actions
RunActions(Tasks.CloseBugs)
Inputs
- action...
- The action to run
Output
Outputs an action which (when run) will run all provided action(s).
SetControlValue(control, value)
Copy linkSet the value of a control
SetControlValue(StatusTextbox, "Done")
Inputs
- control
- The control to set
- value
- The value to set for the control
Output
Outputs an action value which (when run) will set the specified control with value.
SetPackSyncTableConfigValue(targetUrl, settingName, settingValue)
Copy linkSet the sync field setting for a sync table.
Inputs
- targetUrl
- The url to the sync table to update
- settingName
- The sync field setting to modify
- settingValue
- The value to set in settingName
SignUpForCoda()
Copy linkOpen a dialog that prompts the user to sign up for Coda
SignUpForCoda()
Output
An action which when triggered will allow the user to sign up/sign in to Coda if they are not already signed in.