You can use the JSL function Words() to separate a path into its component part, and then take just the last piece. Example:
full_path = {"C:\dir1\dir2\dir3\dir4\file.xlsx"}; i = 1; // setup
full_path[i] = "C:\dir1\dir2\dir3\dir4\file.xlsx";
filename = Words(full_path[i], "\"); // separate the path based on the backslash as a delimiter - returns a list
filename = filename[N Items(filename)]; // get the last string in the list
/*:
"file.xlsx"