Power Automate expressions cheat sheet for document workflows (Malaysia time, dates, file names)

The expressions you'll use most: Malaysian time zone, date formats, file names, null checks and string handling.

LevelBeginner
TimeReference
TopicPower Automate fundamentals

Malaysia time

Windows uses the time zone ID Singapore Standard Time for UTC+8, which also covers Kuala Lumpur.

Convert now to Malaysia time (UTC+8)
convertTimeZone(utcNow(), 'UTC', 'Singapore Standard Time', 'dd MMM yyyy HH:mm')

Dates

Common date expressions
formatDateTime(utcNow(), 'yyyy-MM-dd')          // 2026-10-14
formatDateTime(utcNow(), 'dd MMMM yyyy')        // 14 October 2026
addDays(utcNow(), 30)                           // 30 days from now
startOfMonth(utcNow())                          // first of this month
dateDifference('2026-01-01', utcNow())          // elapsed days (newer environments)

File names

Safe, unique file names
concat('Agreement - ', replace(triggerBody()?['Customer'], '/', '-'), ' - ', formatDateTime(utcNow(),'yyyyMMdd-HHmm'), '.pdf')

// Name without extension
first(split(triggerOutputs()?['body/{FilenameWithExtension}'], '.'))

Null and empty checks

Avoid failures on missing values
coalesce(triggerBody()?['SignerEmail'], '[email protected]')
empty(triggerBody()?['SignerEmail'])
if(empty(variables('x')), 'N/A', variables('x'))

Money in RM

Format a number as RM
concat('RM ', formatNumber(float(triggerBody()?['Amount']), 'N2', 'en-MY'))

Arrays

Useful array functions
length(body('Get_items')?['value'])
union(variables('emails'), variables('emails'))   // de-duplicate
join(body('Select_names'), ', ')

Tips

  • Use ?[] (safe navigation) everywhere when reading trigger data — it returns null instead of failing.