Azure Logic Apps | params in inline js

Abhay Chandramouli 1,056 Reputation points
2023-06-19T10:28:43.3766667+00:00

Hi

Can we access parameters in inline JS ?

or values from configiration app settings ?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 22,031 Reputation points Volunteer Moderator
    2023-06-19T11:53:13.98+00:00

    @Abhay Chandramouli

    Welcome to Microsoft Q&A and thank you for posting your here!!

    You were asking if you can access parameters in inline JS or access values from configuration app settings.

    These are typically two questions and firstly, to access parameters in inline JS is YES! And secondly, to access values from configuration app settings too is YES!

    On the first question though it is YES, you cannot directly access parameters in inline JS.

    A similar case was mentioned on stackoverflow page you can read more here: way to access logic app parameter inside a custom javascript

    In addition, you can access parameters in inline JS in Azure Logic Apps. You can use the "workflowContext" object to access the input parameters of the workflow. Here is an example of how to access the input parameter in inline JS:

    workflowContext.actions.actionName.inputs.parameterName
    

    Where actionName is the name of the action that contains the input parameter and parameterName is the name of the input parameter.

    For more information on how to use inline code in Azure Logic Apps, please refer to Microsoft's documentation.

    Secondly, to access values from configuration app settings. you can access values from configuration app settings in Azure Logic Apps. You can add, update, or delete host settings, which specify the runtime configuration settings and values that apply to all the workflows in that logic app, such as default values for throughput, capacity, data size, and many more.

    Also, you can also make configurable settings in Azure Logic App by declaring all parameters under the 'parameters' section of the definition and then providing values at the time of deployment. To review the app settings for your single-tenant based logic app in the Azure portal, follow these steps:

    • On your logic app menu, under Settings, select Configuration.
    • On the Configuration page, on the Application settings tab, review the app settings for your logic app.
    • For more information about these settings, review the reference guide for available app settings - local.settings.json.
    • To view all values, select Show Values. Or, to view a single value, select that value.
    • To add a setting, follow these steps:
    • On the Application settings tab, under Application settings, select New application setting.
    • For Name, enter the key or name for your new setting.
    • For Value, enter the value for your new setting.

    When you're ready to create your new key-value pair, select OK.

    For more information on the above, you can read Edit host and app settings for Standard logic apps in single-tenant Azure Logic Apps.

    Hope you find this helpful! To let the community and other users know this answer is useful, kindly vote for it. Do not hesitate to contact if you have more questions.

    Best Regards,

    Sina


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.