Skip to main content

Notifications

Community site session details

Community site session details

Session Id : cQU+a7JWXhTpU5bsuOKIDz
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,846 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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Loading started
Loading complete