Need a function to run different queries based on parameters sent subquery must return one column error
So I finally got this to work with this function: 

returns table(  ctype int, cvalue char )
    LANGUAGE sql
     STABLE PARALLEL SAFE
AS $$

   select c.cttype, 
     case 
       when const_scopefk = 1 then --local
       ( select scu.constant_value
        from s0constants_user scu 

        where (scu.constant_name = c.constant_name 
           and scu.empfkey = empid
           and scu.locality_name = locality)
       limit 1)

       when const_scopefk  = 2 then --user
        (select scu.constant_value
        from s0constants_user scu 

        where (scu.constant_name = c.constant_name 
           and scu.empfkey = empid
           and scu.locality_name = '1')
           limit 1)

      when const_scopefk  = 1 then --global
        ( select scu.constant_value
        from s0constants_user scu 

        where (scu.constant_name = c.constant_name
         and scu.empfkey = 0
        and scu.locality_name = '1')
        limit 1 )
    end 
   from public.s0constants c
   where  c.constant_name = UPPER(stname);


$$;````