Solved

Can't put a period next to a Custom Property?

  • 4 November 2022
  • 3 replies
  • 31 views

Badge +4

In my template I have something like this:

 

texthere blabla {{ person|lookup:'amount'|default:'' }}.

 

So it should come out like: texthere blabla $126.

Instead it comes out like: texthere blabla $126 .

 

It puts a space between the custom property and the period while this space is unwanted by me nor put by me when I’m editing the template.

icon

Best answer by David To 7 November 2022, 17:40

View original

3 replies

Userlevel 7
Badge +60

Hey @blissy,

Welcome back to the Community!

I would suggest double checking to see if your profile property value actually has a trailing space. Leading or trailing spaces can cause this odd behavior. 

Whenever you’re referencing a custom profile property using a lookup filter, it’ll return the exact value of the property being referenced. 

Custom Profile Property 
Template using {{ person|lookup:"Phone Type"|default:"" }}?​​​​​​
What’s returned

I hope this helps!

David

Badge +4

Hey @blissy,

Welcome back to the Community!

I would suggest double checking to see if your profile property value actually has a trailing space. Leading or trailing spaces can cause this odd behavior. 

Whenever you’re referencing a custom profile property using a lookup filter, it’ll return the exact value of the property being referenced. 

Custom Profile Property 
Template using {{ person|lookup:"Phone Type"|default:"" }}?​​​​​​
What’s returned

I hope this helps!

David

 

What’s a trailing space and what are you demonstrating with your example?

Userlevel 7
Badge +60

Hey @blissy,

A trailing space is a space that is located after the final character in a text field. Similarly, a leading space that is located before the first character (letter, number, punctuation mark) in a text field. 

In my screenshots, I’m demonstrating what I mentioned. That when you’re referencing a profile property, it’ll return the exact value of the property. 

From my screenshots, the value I have set for the Phone Type property is “Apple Iphone”. When i’m referencing that property using “{{ person|lookup:"Phone Type"|default:"" }}?​​​​​​” it’s returned as “Apple Iphone?”.

Note how because my property value has no trailing spaces, the question mark immediately succeed it. Same thing would occur if I used a period (.) instead of a question mark. 

David

Reply