title: Zapier Java Script TypeError: inputData.lastIndexOf is not a function
body: <p>I am trying to extract the file name from an url;</p>
  <p>I don't think I can do this via formater so I am trying java script. I have been attempting to make this code work;
  <a href="https://stackoverflow.com/questions/26508424/need-to-extract-filename-from-url">Need to extract filename from URL</a></p>
  <pre><code>String url = &quot;https://abc.xyz.com/path/somefilename.xy&quot;;
  String fileName = url.substring(url.lastIndexOf('/') + 1);
  // fileName is now &quot;somefilename.xy&quot;
  </code></pre>
  <p>But I'm having no joy. I have cleared numerous other errors using this code;</p>
  <pre><code>    var output = inputData.substring(inputData.lastIndexOf('/') +1);
      console.log(output);
  </code></pre>
  <p>However I keep getting the error &quot;TypeError: inputData.lastIndexOf is not a function&quot; from Zapier after testing.</p>
  <p>Any and all advice welcome.
  Thanks!</p>