Forum Discussion
The code will look something like this (i'm a rookie when it comes to freemarker so my guess is there's a more elegant way to do this but this works):
<#assign fullName=''/>
<#assign aUser=rest("/users/id/${user.id}").user/>
<#list aUser.profiles.profile as profileList>
<#if profileList.@name=='name_first'>
<#assign fullName=profileList/>
</#if>
<#if profileList.@name=='name_last'>
<#assign fullName=fullName + ' ' + profileList/>
</#if>
</#list>
Unfortunately, this did not work for me. However, we were very close! This is what did work in the end:
<#assign firstname = rest("/users/id/${user.id}/profiles/name/name_first").value/>
<#assign lastname = rest("/users/id/${user.id}/profiles/name/name_last").value/>
That assignment worked, so using this, I could return the string values:
<span>${firstname} ${lastname}</span>
The results are just as I wanted. Looks so simple now! :robothappy: Thanks!
Related Content
- 5 years ago
- 8 years ago
- 10 years ago