Search code examples
htmlformsazureazure-logic-appsazure-cognitive-services

Azure logic app allows only one language for captions translations. How to extend logic app to custom web page?


I have built an Azure logic app, that will output an VTT transcript file, once a video has been uploaded. Link to the API: https://api-portal.videoindexer.ai/docs/services/Operations/operations/Get-Video-Index. However, I am trying to find a way to let a user choose outside of the logic app, what language they want the captions to be translated in.

How can I build a simple web app/page that will allow a user to choose a language from a radio button with a list of languages and then loop that back to a logic app?
For example I want to build something like this and then wire it up to my logic app "Caption Language" field:

How can I create a HTML form and loop that inside my Azure Logic app? What is the efficient way of doing this?


Solution

  • There are 2 things:

    1. How will the user select the item
    2. How you will use it as a parameter in your logic App

    For the 1st point, it's totally up to you: choose the technology you prefer, and go. The thing that you have to understand is how it is linked to the 2nd point.

    What you could do for this 2nd point:

    • Add a custom payload to your Logic App HTTP Trigger content: you can define it by using a sample:

    Payload

    That will create the following schema: Payload schema

    • Use this chosen language as an input in your Logic App query, and set this parameter in the field "Captions language", using "Enter custom value":

    Captions lang

    You must point to the value in your payload:

    setup lang

    So when you call your logic app from your web page, ensure that when you submit your form, your make a POST to your logic app url and pass in the body a content which is

    { "lang": "yourSelectedLanguageCode" }