We combine information from the clustering of HI galaxies in the 100% data release of the Arecibo Legacy Fast ALFA survey (ALFALFA), and from the HI content of optically-selected galaxy groups found in the Sloan Digital Sky Survey (SDSS) to constrain the relation between halo mass $M_h$ and its average total HI mass content $M_{rm HI}$. We model the abundance and clustering of neutral hydrogen through a halo-model-based approach, parametrizing the $M_{rm HI}(M_h)$ relation as a power law with an exponential mass cutoff. To break the degeneracy between the amplitude and low-mass cutoff of the $M_{rm HI}(M_h)$ relation, we also include a recent measurement of the cosmic HI abundance from the $alpha$.100 sample. We find that all datasets are consistent with a power-law index $alpha=0.44pm 0.08$ and a cutoff halo mass $log_{10}M_{rm min}/(h^{-1}M_odot)=11.27^{+0.24}_{-0.30}$. We compare these results with predictions from state-of-the-art magneto-hydrodynamical simulations, and find both to be in good qualitative agreement, although the data favours a significantly larger cutoff mass that is consistent with the higher cosmic HI abundance found in simulations. Both data and simulations seem to predict a similar value for the HI bias ($b_{rm HI}=0.875pm0.022$) and shot-noise power ($P_{rm SN}=92^{+20}_{-18},[h^{-1}{rm Mpc}]^3$) at redshift $z=0$.