You can use a Run Shell Script Action, with the following code:
echo ${1##*/}
and Pass input: set to as arguments.

This will filter the passed input, giving only the file basename as output.
You should put this step before the action that sets FolderName variable.