Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

How to interpolate variables in strings in AL, without concatenation?

(0) ShareShare
ReportReport
Posted on by 47

I have a statement like that:

JSONStrContentOfRequest := '{"name":"'+name+'","age":"' + age + '"}';

If there's a way I can write it without doing concatenation, like if we were in Javascript, we write with Template literals `` like this:

`{"name":"${name}","age":"${age}"}`;

  • Suggested answer
    YUN ZHU Profile Picture
    81,365 Super User 2025 Season 1 on at
    RE: How to interpolate variables in strings in AL, without concatenation?

    Hi, As far as I know, this method is not supported in AL, you can refer to Inge's suggestion and use Json object. Erik's video below makes it easy to understand.

    https://www.youtube.com/watch?v=so7_bOxp9V4

    https://www.youtube.com/watch?v=BpLJy6HwXyo

    pastedimage1664322908407v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,021 Moderator on at
    RE: How to interpolate variables in strings in AL, without concatenation?

    Did you study the AL data type of Json object?

    learn.microsoft.com/.../jsonobject-data-type

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,110 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans