Friend information isn't necessarily automatically kept up to date. You can use C_FriendList.ShowFriends() to request an update from the server.
Example[]
localf=C_FriendList.GetFriendInfoByIndex(1)print(format("Your friend %s (level %d %s) is in %s",f.name,f.level,f.className,f.area))-- Your friend Aërto (level 74 Warrior) is in Sholazar Basin
Patch changes[]
Patch 8.2.5 (2019-09-24): Added rafLinkType field. Patch 8.2.0 (2019-06-25): Added mobile field. Patch 8.1.0 (2018-12-11): Moved to C_FriendList.GetFriendInfo()[1] Patch 2.4.0 (2008-03-25): Added note return.[2] Patch 1.0.0 (2004-10-08): Added as GetFriendInfo()