5

I have a logic app that looks something like this: enter image description here

In the js code action, I just wanted to check if the name of the file (that had triggered the workflow) match some pattern. So my Inline code action has something like:

    var input = workflowContext.trigger.outputs.headers.x-ms-file-name;
    if(input.match(/^([0-9]){3}_Hello/))
        return true;
    else 
        return false;

However, it seems that the action can't get the file name because the x-ms-file-name is splitted by a '-'. So, I tried to solve this problem by creating a variable called fileName in an the action before it enter image description here

and then use it in the inline code action. But I don't know how to call the variable inside inline code action. What should I write here:

    var input = ????;
    if(input.match(/^([0-9]){3}_Hello/))
        return true;
    else 
        return false;

Any suggestion to how to solve this problem?

Note (I am not sure if it is relevant but in case it helps): I am using the standard logic app so I amp supposed to not have/use Integration account

ibda
  • 376
  • 3
  • 15

1 Answers1

0

It seems that I can just simply write the following in the inline action:

    var input = workflowContext.trigger.outputs.headers['x-ms-file-name'];
    if(input.match(/^([0-9]){3}_Hello/))
        return true;
    else 
        return false;
ibda
  • 376
  • 3
  • 15