Page 1 of 1

Return Ownership Profile Name

Posted: Tue Feb 06, 2024 4:14 pm
by kendale.wyatt
What's the best way to pull just the name of the Ownership Profile? I tried {{Order.OwnershipProfile.Name}} but the error that returns in "The 'Name' field does not exist on context 'ProfileInfo'. "

When I just use {{Order.OwnershipProfile}} I get the full path like Default\Test&Training\Development&Production but I just need the name of the profile which is "Development&Production" in this example.

Thanks!

Re: Return Ownership Profile Name

Posted: Tue Feb 06, 2024 5:20 pm
by BobRichards
Have you tried: {{Order.OwnershipProfile.Name}}

Re: Return Ownership Profile Name

Posted: Thu Feb 08, 2024 11:55 am
by kendale.wyatt
I did, that's when I get the error message:
"The 'Name' field does not exist on context 'ProfileInfo'."

Re: Return Ownership Profile Name

Posted: Fri Feb 09, 2024 12:16 pm
by BobRichards
I asked a colleague in the documents department to take a look at your problem. He agreed with you that {{Order.OwnershipProfile.Name}} does not exist. He created some code to help you get the value. If you have any issues, please check back with us with the symptoms.
<VAR $ProfileName ("")>
<VAR $Slash1 (InString({{Order.OwnershipProfile}},"\"))>
<VAR $IsSlash2 ({{$Slash1}}+1)>
<IF (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash2}},0),"\")>0)>
<VAR $Slash2 (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash2}},0),"\"))>
<VAR $IsSlash3 ({{$Slash1}}+{{$Slash2}}+1)>
<IF (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash3}},0),"\")>0)>
<VAR $Slash3 (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash3}},0),"\"))>
<ELSE>
<VAR $ProfileName (SubString({{Order.OwnershipProfile}},{{$IsSlash3}},0))>
</IF>
<ELSE>
<VAR $ProfileName (SubString({{Order.OwnershipProfile}},{{$IsSlash2}},0))>
</IF>

All they have to do is add the coding above to their document – and wherever they want to display the Profile Name, simply use the Variable Field Code {{$ProfileName}}

Hope this helps!

Re: Return Ownership Profile Name

Posted: Fri Feb 09, 2024 12:41 pm
by kendale.wyatt
That worked perfectly, thank you!