0% found this document useful (0 votes)
45 views

.Functions List

This document contains a list of formulas for date/time, logical, math, and text operations. It includes the formula name, parameters, and a brief description of what each formula does.

Uploaded by

Mohamed Mougi
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

.Functions List

This document contains a list of formulas for date/time, logical, math, and text operations. It includes the formula name, parameters, and a brief description of what each formula does.

Uploaded by

Mohamed Mougi
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Category Formula

Date/time addDays('<timestamp>', <days>, '<format>'?)

Date/time addHours('<timestamp>', <hours>, '<format>'?)

Date/time addMinutes('<timestamp>', <minutes>, '<format>'?)


Date/time addSeconds('<timestamp>', <seconds>, '<format>'?)
Date/time addToTime('<timestamp>', <interval>, '<timeUnit>', '<format>'?)

Date/time convertFromUtc('<timestamp>', '<destinationTimeZone>',


'<format>'?)

Date/time convertTimeZone('<timestamp>', '<sourceTimeZone>',


'<destinationTimeZone>', '<format>'?)

Date/time convertToUtc('<timestamp>', '<sourceTimeZone>', '<format>'?)

Date/time dateDifference('<startDate>', '<endDate>')

Date/time dayOfMonth('<timestamp>')
Date/time dayOfWeek('<timestamp>')
Date/time dayOfYear('<timestamp>')
Date/time formatDateTime('<timestamp>', '<format>'?, '<locale>'?)

Date/time getFutureTime(<interval>, <timeUnit>, <format>?)

Date/time getPastTime(<interval>, <timeUnit>, <format>?)

Date/time parseDateTime('<timestamp>', '<locale>'?, '<format>'?)

Date/time startOfDay('<timestamp>', '<format>'?)


Date/time startOfHour('<timestamp>', '<format>'?)
Date/time startOfMonth('<timestamp>', '<format>'?)
Date/time subtractFromTime('<timestamp>', <interval>, '<timeUnit>',
'<format>'?)
Date/time utcNow('<format>')

Logical and(<expression1>, <expression2>, ...)

Logical bool(<value>)
Logical empty('<collection>')
empty([<collection>])
Logical equals('<object1>', '<object2>')

Logical greater(<value>, <compareTo>)


greater('<value>', '<compareTo>')
Logical greaterOrEquals(<value>, <compareTo>)
greaterOrEquals('<value>', '<compareTo>')
Logical if(<expression>, <valueIfTrue>, <valueIfFalse>)

Logical less(<value>, <compareTo>)


less('<value>', '<compareTo>')
Logical lessOrEquals(<value>, <compareTo>)
lessOrEquals('<value>', '<compareTo>')
Logical not(<expression>)

Logical or(<expression1>, <expression2>, ...)

Math add(<summand_1>, <summand_2>)


Math decimal('<value>')

Math div(<dividend>, <divisor>)


Math float('<value>', '<locale>'?)
Math int('<value>')
Math isFloat('<string>', '<locale>'?)
Math isInt('<string>')
Math max(<number1>, <number2>, ...)
max([<number1>, <number2>, ...])
Math min(<number1>, <number2>, ...)
min([<number1>, <number2>, ...])
Math mod(<dividend>, <divisor>)
Math mul(<multiplicand1>, <multiplicand2>)
Math rand(<minValue>, <maxValue>)
Math sub(<minuend>, <subtrahend>)
Text array('<value>')
Text concat('<text1>', '<text2>', ...)
Text contains('<collection>', '<value>')
contains([<collection>], '<value>')
Text createArray('<object1>', '<object2>', ...)
Text endsWith('<text>', '<searchText>')

Text first('<collection>')
first([<collection>])
Text formatNumber(<number>, <format>, <locale>?)
Text indexOf('<text>', '<searchText>')

Text join([<collection>], '<delimiter>')


Text last('<collection>')
last([<collection>])
Text lastIndexOf('<text>', '<searchText>')

Text length('<collection>')
length([<collection>])
Text nthIndexOf('<text>', '<searchText>', <occurrence>)
Text range(<startIndex>, <count>)
Text replace('<text>', '<oldText>', '<newText>')
Text reverse([<collection>])

Text slice('<text>', <startIndex>, <endIndex>?)

Text sort([<collection>], <sortBy>?)


Text split('<text>', '<delimiter>')

Text startsWith('<text>', '<searchText>')

Text string(<value>)
Text substring('<text>', <startIndex>, <length>)

Text take('<collection>', <count>)


take([<collection>], <count>)
Text toLower('<text>')

Text toUpper('<text>')

Text trim('<text>')
Text union('<collection1>', '<collection2>', ...)
union([<collection1>], [<collection2>], ...)

Workflow action()
action().outputs.body.<property>
Workflow actionBody('<actionName>')
Workflow actionOutputs('<actionName>')

Workflow actions('<actionName>')
actions('<actionName>').outputs.body.<property>

Workflow base64('<value>')
Workflow body('<actionName>')

Workflow item()

Workflow items('<loopName>')
Workflow outputs('<actionName>')

Workflow trigger()

Workflow triggerOutputs()
Description
Add days to a timestamp.

Add hours to a timestamp.

Add minutes to a timestamp.


Add seconds to a timestamp.
Add the specified time units to a timestamp. See also getFutureTime().

Convert a timestamp from Universal Time Coordinated (UTC) to the target time zone.

Convert a timestamp from the source time zone to the target time zone.

Convert a timestamp from the source time zone to Universal Time Coordinated (UTC).

Return the difference between two timestamps as a timespan. This function


subtracts startDate from endDate, and returns the result as timestamp in string format.
Return the day of the month from a timestamp.
Return the day of the week from a timestamp.
Return the day of the year from a timestamp.
Return a timestamp in the specified format.

Return the current timestamp plus the specified time units.

Return the current timestamp minus the specified time units.

Return the timestamp from a string that contains a timestamp.

Return the start of the day for a timestamp.


Return the start of the hour for a timestamp.
Return the start of the month for a timestamp.
Subtract a number of time units from a timestamp. See also getPastTime.
Return the current timestamp.

Check whether all expressions are true. Return true when all expressions are true, or return false when at
least one expression is false.
Return the Boolean version of a value.
Check whether a collection is empty. Return true when the collection is empty, or return false when not
empty.
Check whether both values, expressions, or objects are equivalent. Return true when both are equivalent,
or return false when they're not equivalent.
Check whether the first value is greater than the second value. Return true when the first value is more,
or return false when less.
Check whether the first value is greater than or equal to the second value. Return true when the first
value is greater or equal, or return false when the first value is less.
Check whether an expression is true or false. Based on the result, return a specified value. Parameters
are evaluated from left to right.
Check whether the first value is less than the second value. Return true when the first value is less, or
return false when the first value is more.
Check whether the first value is less than or equal to the second value. Return true when the first value is
less than or equal, or return false when the first value is more.
Check whether an expression is false. Return true when the expression is false, or return false when true.

Check whether at least one expression is true. Return true when at least one expression is true, or return
false when all are false.
Return the result from adding two numbers.
Returns a decimal number in a string as a decimal number. You can use this function when you're
working with data that requires decimal precision and also as input for logical comparison
functions and math functions. To capture and preserve precision when you use the result from
the decimal() function, wrap any decimal output with the string function. This usage is shown in the
following examples below where you can lose precision if you use the decimal result as a number.

Return the result from dividing two numbers. To get the remainder result, see mod().
Convert a string version for a floating-point number to an actual floating point number.
Convert the string version for an integer to an actual integer number.
Return a boolean indicating whether a string is a floating-point number
Return a boolean that indicates whether a string is an integer.
Return the highest value from a list or array with numbers that is inclusive at both ends.

Return the lowest value from a set of numbers or an array.

Return the remainder from dividing two numbers. To get the integer result, see div().
Return the product from multiplying two numbers.
Return a random integer from a specified range, which is inclusive only at the starting end.
Return the result from subtracting the second number from the first number.
Return an array from a single specified input. For multiple inputs, see createArray().
Combine two or more strings, and return the combined string.
Check whether a collection has a specific item. Return true when the item is found, or return false when
not found. This function is case-sensitive.
Return an array from multiple inputs. For single input arrays, see array().
Check whether a string ends with a specific substring. Return true when the substring is found, or return
false when not found. This function isn't case-sensitive.
Return the first item from a string or array.

Return a number as a string that's based on the specified format.


Return the starting position or index value for a substring. This function isn't case-sensitive, and indexes
start with the number 0.
Return a string that has all the items from an array and has each character separated by a delimiter.
Return the last item from a collection.

Return the starting position or index value for the last occurrence of a substring. This function isn't case-
sensitive, and indexes start with the number 0.
Return the number of items in a collection.

Return the starting position or index value where the nth occurrence of a substring appears in a string.
Return an integer array that starts from a specified integer.
Replace a substring with the specified string, and return the result string. This function is case-sensitive.
Reverse the order of items in a collection. When you use this function with sort(), you can sort a
collection in descending order.
Return a substring by specifying the starting and ending position or value. See also substring().

Sort items in a collection. You can sort the collection objects using any key that contains a simple type.
Return an array that contains substrings, separated by commas, based on the specified delimiter
character in the original string.
Check whether a string starts with a specific substring. Return true when the substring is found, or return
false when not found. This function isn't case-sensitive.
Return the string version for a value.
Return characters from a string, starting from the specified position, or index. Index values start with the
number 0. See also slice().
Return items from the front of a collection.

Return a string in lowercase format. If a character in the string doesn't have a lowercase version, that
character stays unchanged in the returned string.
Return a string in uppercase format. If a character in the string doesn't have an uppercase version, that
character stays unchanged in the returned string.
Remove leading and trailing whitespace from a string, and return the updated string.
Return a collection that has all the items from the specified collections. To appear in the result, an item
can appear in any collection passed to this function. If one or more items have the same name, the last
item with that name appears in the result.

Return the current action's output at runtime, or values from other JSON name-and-value pairs, which
you can assign to an expression. By default, this function references the entire action object, but you can
optionally specify a property whose value you want.
Return an action's body output at runtime. Shorthand for actions('<actionName>').outputs.body.
Return an action's output at runtime. and is shorthand for actions('<actionName>').outputs.
See actions(). The actionOutputs() function resolves to outputs() in the designer, so consider
using outputs(), rather than actionOutputs(). Although both functions work the same way, outputs() is
preferred.
Return an action's output at runtime, or values from other JSON name-and-value pairs, which you can
assign to an expression. By default, the function references the entire action object, but you can
optionally specify a property whose value that you want. For shorthand versions,
see actionBody(), actionOutputs(), and body(). For the current action, see action().
Return the base64-encoded version for a string.
Return an action's body output at runtime. Shorthand for actions('<actionName>').outputs.body.
See actionBody() and actions().
When used inside a repeating action over an array, return the current item in the array during the action's
current iteration. You can also get the values from that item's properties.
Return the current item from each cycle in a for-each loop. Use this function inside the for-each loop.
Return an action's outputs at runtime. Use this function, rather than actionOutputs(), which resolves
to outputs() in the designer. Although both functions work the same way, outputs() is preferred.
By default, the function references the entire trigger object, but you can optionally specify a property
whose value that you want. Also, this function has shorthand versions available,
see triggerOutputs() and triggerBody().
Return a trigger's output at runtime, or values from other JSON name-and-value pairs. Shorthand
for trigger().outputs. See trigger().
Example
addDays('2018-03-15T00:00:00Z', 10)
addDays('2018-03-15T00:00:00Z', -5)
addHours('2018-03-15T00:00:00Z', 10)

addMinutes('2018-03-15T00:10:00Z', 10)
addSeconds('2018-03-15T00:00:00Z', 10)
addToTime('2018-01-01T00:00:00Z', 1, 'Day')
addToTime('2018-01-01T00:00:00Z', 1, 'Day', 'D')
convertFromUtc('2018-01-01T08:00:00.0000000Z',
'Pacific Standard Time')
convertFromUtc('2018-01-01T08:00:00.0000000Z',
'Pacific Standard Time', 'D')
convertTimeZone('2018-01-01T08:00:00.0000000Z',
'UTC', 'Pacific Standard Time')
convertTimeZone('2018-01-01T80:00:00.0000000Z',
'UTC', 'Pacific Standard Time', 'D')
convertToUtc('01/01/2018 00:00:00', 'Pacific
Standard Time')
convertToUtc('01/01/2018 00:00:00', 'Pacific
Standard Time', 'D')
dateDifference('2015-02-08', '2018-07-30')

dayOfMonth('2018-03-15T13:27:36Z')
dayOfWeek('2018-03-15T13:27:36Z')
dayOfYear('<timestamp>')
formatDateTime('03/15/2018 12:00:00', 'yyyy-MM-
ddTHH:mm:ss')
formatDateTime('01/31/2016', 'dddd MMMM d')

getFutureTime(5, 'Day')
getFutureTime(5, 'Day', 'D')
getPastTime(5, 'Day')
getPastTime(5, 'Day', 'D')
parseDateTime('21052019', 'fr-fr', 'ddMMyyyy') //
Returns '2019-05-21T00:00:00.0000000'.
parseDateTime('10/20/2014 15h', 'en-US',
'MM/dd/yyyy HH\h') // Returns '2014-10-
20T15:00:00.0000000'.

startOfDay('2018-03-15T13:30:30Z')
startOfHour('2018-03-15T13:30:30Z')
startOfMonth('2018-03-15T13:30:30Z')
subtractFromTime('2018-01-02T00:00:00Z', 1, 'Day')
utcNow() --- And returns this result: "2018-04-
15T13:00:00.0000000Z"
utcNow('D') --- And returns this result: "Sunday,
April 15, 2018"
and(true, true)

empty('')
empty('abc')
equals('abc', 'abcd')

greater(10, 5)

greaterOrEquals(5, 5)

if(equals(1, 1), 'yes', 'no')

less(5, 10)

lessOrEquals(10, 10)

not(false)

or(true, false)

add(1, 1.5)
#VALUE!

div(10,5)
float('10,000.333')
int('10')
isFloat('10,000.00')
isInt('10')
max(1, 2, 3)

min(1, 2, 3)

mod(3, 2)
mul(1, 2)
rand(1, 5)
sub(10.3, .3)
array('hello')
concat('Hello', 'World')
contains('hello world', 'world')

createArray('h', 'e', 'l', 'l', 'o')


endsWith('hello world', 'world')

first('hello')

formatNumber(1234567890, '0,0.00', 'en-us')


indexOf('hello world', 'world')

join(createArray('a', 'b', 'c'), '.')


last('abcd')

lastIndexOf('hello world hello world', 'world')

length('abcd')

nthIndexOf('123456789123465789', '12', 2)
range(1, 4)
replace('the old string', 'old', 'new')
reverse(createArray(0, 1, 2, 3))

slice('Hello World', 2, 5) // Returns 'llo'.


slice('Hello World', 3, -1) // Returns 'lo Worl'.
slice('Hello World', 2) // Returns 'llo World'.
slice('Hello World', -2) // Returns 'ld'.
sort(createArray(2, 1, 0, 3))
split('a_b_c', '_')

startsWith('hello world', 'hello')

string(10)
substring('hello world', 6, 5)

take('abcde', 3)

toLower('Hello World')

toUpper('Hello World')

trim(' Hello World ')


union(createArray(1, 2, 3), createArray(1, 2, 10,
101)) ------ And returns this result: [1, 2, 3, 10, 101]
actionBody('Get_user')
actionOutputs('Get_user')

actions('Get_user').outputs.body.status

base64('hello')
body('Get_user')

item().body

items('myForEachLoopName')
outputs('Get_user')
Formula
last(split(items('Apply_to_each')['name'],'.')),
addHours(convertFromUtc(body('Start_and_wait_for_an_approval')?['completionDate'], 'Arab Standard Time'), -3, 'yyyy-MM-
hh:mm tt')

addHours(convertFromUtc(body('Start_and_wait_for_an_approval')?['completionDate'], 'Arab Standard Time'), -3, 'yyyy-MM-

@equals(triggerOutputs()?[‘body/RequestedTopic’], ‘Power Automate’)


@contains(triggerBody()?['Subject'], 'Daily Statement')
body('Start_and_wait_for_an_approval')?['responses']?[0]?['comments']

body('Start_and_wait_for_an_approval')?['responses']?[0]?['responder']?['displayName']
body('Start_and_wait_for_an_approval')?['responses']?[0]?['responder']?['email']
Description
use this expression to get the extension of the file.
to change date format to date and time.

To change date format to date only.

To trigger based on criteria, add it from setting


we need to add @ before the trigger function.
0 is the index of responses array to pick up the comment, ? to not throw an error when there's no
comment, we have to put question mark before each square bracket to avoid throwing error if
it’s null.
[‘responses’]?[0], first response in the responses array, The index is to locate the item we need
in the array(list), The index is being used when we have more than one response or
approvers(responders) in the same approval connector and all must approve.

Approval Name
Approval Email

You might also like