Logic app workflow involves a string or JSON object created from multiple inputs of different data types

In Azure Logic Apps, lets you bring together a string or JSON object from various inputs that come in different data types (e.g., strings, numbers, objects, etc.). It’s a neat way to handle diverse data and make them work together!

Steps to Create the Logic App Workflow

  1. Create a new Logic App:
    • Go to the Azure portal.
    • Click on “Create a resource” and search for “Logic App”.
    • Follow the prompts to create a new Logic App.
  2. Add a Trigger:
    • Once your Logic App is created, open it in the Logic App Designer.
    • Choose a trigger to start your workflow. For example, you can use a “Recurrence” trigger to run the workflow at a specific interval.
  3. Initialize Variables:
    • Initialize different types of variables using the “Initialize Variable” action. This example includes integer, float, string, boolean, object, and array variables.
  4. Compose Action:
    • Use the “Compose” action to create a JSON object or a string from the variables.
Here's how Logic App should look:
estudy247-la-test-compose-09

Example Workflow

  • The “Recurrence” trigger runs the logic app once a month.
  • Different types of variables (integer, string, boolean) are initialized with specific values.
    • Inputs:
      • name (string): "Ravi"
      • age (number): 35
      • isActive (boolean): true
  • The “Compose_JSON” action creates a JSON object that includes all the variables.
    • construct the JSON object manually:
      {
        "name": "@{variables('nameVar')}",
        "age": @variables('ageVar'),
        "isActive": @variables('activeVar')
      }
    • The output will be:
      {
        "name": "Ravi",
        "age": 35,
        "isActive": true
      }
  • The “Compose_String” action creates a string representation of all the variables.
    • use the concat function or string interpolation:
      @concat('Name: ',variables('nameVar'),', Age: ',variables('ageVar'),', Active: ',variables('activeVar'))
    • The output will be:
      Name: Ravi, Age: 35, Active: true
You can customize this example based on your specific requirements. Let me know if you need more detailed instructions on any specific action or workflow in your Logic App

You can download the logic app template from the estudy247 GitHub repository – la-test-compose-09

Post a comment

Leave a Comment

Scroll to Top