You shouldn't use a variable that is created inside a case outside of that case.
It should be written as:
Id = case is_integer(StreamId) of
   true ->
       integer_to_list(Streamid);
   _ ->
       StreamId
end,