Get Logic App Name in Logic App

{tocify} $title={Table of Contents}


Introduction


In many scenarios we need to get the details of the workflow which is executing, one such requirement is in context to logging.

Apart from all the details we are logging, having a name, runid etc of logic app name is also helpful.


How to Get Logic App Name in Logic App


There is inbuilt function available - workflow() which can be used to get the workflow name and other properties related to workflow.


To demonstrate, I have made use of variable to which value of logic app name is assigned.

use workflow function in expression to get logic app name

As can be seen above, have initialized a variable named laname and used following workflow function in Expression to get logic app name against Value.
                            
                                workflow().name

If you see below, the name of logic app is LiquidMapChecker, so this is what we should get as value in the variable.

assigning workflow name to a variable


Testing


To test this I simply triggered the Logic app, and checked the result in the Run history

value of workflow name is assigned to variable


That's it... value of workflow name is assigned to variable.



What else Workflow() function in Logic App provides

Workflow function returns all the details about the workflow itself during run time.

Workflow function gives access to following properties: name, type, id, location, run, and tags.

To get value of any of the property, simply use following expression

                                 workflow().<property>




Learn More about Logic App

Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post