Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 2TjeZyyDfxevpDGXoC/MCJ
Power Pages - Design & Build
Answered

Concatenate number and string in liquid

Like (0) ShareShare
ReportReport
Posted on 21 Feb 2023 12:32:28 by 80

Hi,

 

I need to be able to concatenate a number and a string from a fetchxml query.

 

I've tried

{%assign holeDiam = result['cr203_holesize'] | append: ' - ' | append: diamUnit.Label %}

 

but it didn't work.

 

How can I do this?

 

Thanks

 

  • Verified answer
    Fubar Profile Picture
    7,885 Super User 2025 Season 1 on 21 Feb 2023 at 23:02:42
    Re: Concatenate number and string in liquid

    Convert the number to a string before putting it in the append.

    {% assign foo = 8 | string %} 
    {% assign Whoop = 'sometext' | append: '.js' | append: foo %}
    {{ Whoop }}
    
    Output:
    sometext.js8
    
    vs this:
    {% assign Whoop = 'sometext' | append: '.js' | append: 8 %}
    {{ Whoop }}
    will give a Liquid int cant conver to string error
    

     (you may possibly also be able to use Liquid capture rather than assign and possibly not have to convert to string)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Pages - Design & Build

#1
oliver.rodrigues Profile Picture

oliver.rodrigues 33 Most Valuable Professional

#2
JB-10040341-0 Profile Picture

JB-10040341-0 14

#3
Fubar Profile Picture

Fubar 11 Super User 2025 Season 1

Overall leaderboard

Featured topics

Loading started