"了" usually comes at the end of a sentence. In most cases, it carries a meaning of the English "ed" (as in the "ed" you add behind a verb to show past tense) or "already". I am native to Cantonese (not Mandarin) but I guess in your sentence's case, the sentence means "the office is on the 3rd floor, we go up to the building (floor), to get the library card fixed first"