The hymn is mentioned, without reference, in most of the popular accounts about him, but I haven't managed to track down a text. I had a look at his entry in
Acta Sanctorum (1725 ed., Iulii t. 4:452-471), which quotes some hymns about Frederik, but none by him. I also tried the version of
Analecta hymnica medii aevi online at
archive.org without success (the 57 vols seem to me almost impossible to use as they are found there and I don't have access to the commercial database version.)