0

I have created a 1st Logic app : that allows a user to upload a .mp4 media file into a folder on OneDrive, and the logic app checks to see if there is new file on that OneDrive folder. If there is new file, it will trigger the logic app and Index the video onto https://www.videoindexer.ai/.

2nd - Logic App : After the video is indexed to https://www.videoindexer.ai/ , I want the user to pick language(s) from the custom web page that I have created, for caption translation. Once the user choose the language(s) they click on "submit" and this will send the data(languages) to my 2nd logic app URL end-point, and trigger my second logic app(shown below) and get the captions based on the user's selection of languages. Finally, it will then output those caption files on to a OneDrive folder.

Right now, the caption file names are in format of : videoID_language.vtt (Example: e0b3483dd1_en-US.vtt). The problem with this format is that, lets say we have multiple videos, the user will find it hard to match which caption file belongs to which video. So that is why I am looking to add video title name, so that they know which caption file are for which video.

My question is: How can I also add video Name to the file as well? So lets say I have video tile such as "AzureFunction". I want my VTT file name to look like this AzureFunction_e0b3483dd1_en-US.vtt

What I tried to do was change the file name query From this:
concat(triggerOutputs()['body']['videoId'],'',item(),'.vtt') TO this: concat(triggerOutputs()['body']['name']['videoId'],'',item(),'.vtt')

But it gives an error because, it does't know the 'name'. How to include the video name as part of my title?

Here is the 2nd logic app workflow, that I am using to create the file: enter image description here enter image description here enter image description here enter image description here

Peter
  • 71
  • 1
  • 10

1 Answers1

0

What I tried to do was change the file name query From this: concat(triggerOutputs()['body']['videoId'],'',item(),'.vtt') TO this: concat(triggerOutputs()['body']['name']['videoId'],'',item(),'.vtt')

triggerOutputs() returns a JSON object. Based on the FIRST code, that JSON structure is body (object) > videoId (property). Changing it to your SECOND version indicates that the structure is body (object) > name (object) > videoId (property). It seems unlikely that the name property has a videoId subproperty.

More importantly, you said the error indicated "it doesn't know the name", which would indicate that there is no name property on the triggerBody. You say you tried to concat the video name - how are you getting the name of the video? Or is that your question? Since the triggerBody is an HTTP request, it is not clear that the video name is part of the HTTP request. If you have the ID, is there another Video Indexer action that you could use to retrieve the Name?

Joel Cochran
  • 7,139
  • 2
  • 30
  • 43