Thursday, September 8, 2022

Power Automate (Flow) Expression usage samples


Get list items from Array

item()?['weborder']

Get compose output body content

outputs('Get_file_content')?['body']

Get Blob content

outputs('Get_blob_content_using_path_(V2)')?['body']

outputs('Get_blob_content_using_path_(V2)')?['value']


Split string by comma

split(variables('<var name>'),',')


Decode CSV file from Blob DECODE URI:

split(outputs('Get_blob_content_using_path_(V2)')?['body'], decodeUriComponent('%0D%0A'))

Skip output line 1

skip(outputs('splitNewLine'),2)

Get output value from list

outputs('OutputJSON')?['WebOrderNo']

outputs('D365FOSelectOut')?['body']

Find length of array

length(body('D365FOSelectOut'))

Concat string

concat(variables('OutputArrayResult'),outputs('D365FOSelectOut')?['body'])

Append array variables (Reference Blog) using Append to array variable (Action)

https://www.enjoysharepoint.com/power-automate-array-variable/

Get output Body/Value

outputs('Lists_items_present_in_table')?['body/value']

Date time format: (Reference Blog)
https://sharepains.com/2018/11/12/formatdatetime-power-automate/


Convert: (while using HTTP request output content type is octet stream, but excepted should be in Text/csv. Follow below

Header; Add in addition to existing header
"x-ms-access-tier-inferred": true

output:
{
"$content-type":  "application/octet-stream",
"$content":  "Ww0KICB7DQogICCJyZWNlaXZlciI6ICIgMTIzODUiLA0KICAgICJwYXlsb2FkIjogIiB7J21lc3NhZ2UnOiAndGVzdCAxJyIsDQogICAgIm9wZXJhdG9yIjogIiAnRW5naW5lSWQnOiAzIiwNCiAgICAic2VuZGVyIjogIiAnUGVyc29uSWQnOiAxIg0KICB9LA0KICB7DQogICAgImlkIjogIjIiLA0KICAgICJyZWNlaXZlciI6ICIgMTIzNDciLA0KICAgICJwYXlsb2FkIjogIiB7J21lc3NhZ2UnOiAndGVzdCAyJyIsDQogICAgIm9wZXJhdG9yIjogIiAnRW5naW5lSWQnOiAzIiwNCiAgICAic2VuZGVyIjogIiAnUGVyc29uSWQnOiAyIg0KICB9DQpd"
}

then we use

string(triggerBody()) ex: string(outputs('HTTPGetBlobContent')?['body'])

Date difference:
div(sub(ticks({EndDateTime}),ticks({StartDateTime})),864000000000)
div(sub(ticks({EndDateTime}),ticks({StartDateTime})),36000000000)
div(sub(ticks({EndDateTime}),ticks({StartDateTime})),600000000)
div(sub(ticks({EndDateTime}),ticks({StartDateTime})),10000000)

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...