Power Automate useful things

In List rows, how to filter on 2 or more things:

name eq 'Yertle Turtle' and address1_city eq 'Pond'

name eq 'Basic User' or name eq 'Delegate'

Get the first item from a list rows:

first(outputs(List_rows_in_users')?['body/value'])?['systemuserid']

Check to see items are returned:

length(outputs('List_records')?['body/value']) in condition is greater than 0

Get a portion of a string:

3 ways, slice(),split() or substring(). Use substring when you know the string’s format. Split turns the string into an array if you have a useful splitting character.

i.e. split(‘Your ticket has been updated[IT-1111]’, ‘IT-‘) will bring back an array:

[

“Your ticket has been updated[“,

“1111]”

] and then use replace() to remove the trailing ] –

replace(‘1111]’,’]’,”)

Slice() takes the string and two further parameters which are usually indexof expressions –

slice(

outputs(‘Get_email_template_row_by_ID’)?[‘body/subjectsafehtml’],

add(indexof(outputs(‘Get_email_template_row_by_ID’)?[‘body/subjectsafehtml’],'”>’),2),

indexof(outputs(‘Get_email_template_row_by_ID’)?[‘body/subjectsafehtml’],'</div>’)

)

Get the trigger details for create or modify

triggerOutputs()?[‘body/SdkMessage’] returns Create, Update.

If Syntax : if(equals(outputs(‘AccountRecord’)?[‘body/industrycode’], 1), ‘Yes’, ‘No’)

Check to see if a null value is returned:

if(equals(email,null),dothis,dothat)

Check to see if a empty cell in Excel is returned:

Trigger conditions to allow or prevent Flow from firing:

  • @not(contains(triggerBody()?['from'],'help@mydomain.co.uk')) for email
  • @true(triggerBody()?['my_field'])
  • @not(empty(triggerBody()?['ltcit_ithelpdeskusers']))

Get a URL to the current Flow (geo region may need to change!)

concat('https://unitedkingdom.flow.microsoft.com/manage/environments/',workflow()['tags']['environmentName'],'/flows/',workflow()['name'],'/runs/',workflow()['run']['name'])

Simplifying Writing expressions:

Instead of :

body('Filter_array_Result')[0]?['outputs']?['body']['error']?['message']

you can write more simply

body('Filter_array_Result')[0].outputs.body.error.message

Need to look into more for sure!

Get the triggering user:

triggerBody()['RunAsSystemUserId']  

or

triggerOutputs()?[‘body/RunAsSystemUserId’]

Write a null user to an entity record lookup, when confronted with systemuser(null).

Escape out quotes in strings:

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s