web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / variable with 'new lin...
Power Apps
Unanswered

variable with 'new line', doesn't get converted in MS Flow

(0) ShareShare
ReportReport
Posted on by
Hi,
Could anyone suggest a solution for a inconsistency between PowerApps and PowerAutomate, when converting a new line, Char(13), <br>?

I tried the following syntax it in the PowerApps TextInput.Default:
Concat(ComboBox.SelectedItems,Value & Char(13) & "<br>")

In PowerApps this ofcourse displays <br> instead of converting it in a new line, as on the picture bellow 
blabla70_6-1685110503805.png

 


On the other hand it works well and converts in new line, in PowerAutomate 'Send an email (V2)':
blabla70_5-1685110473278.png

But again is incorrect in PowerAutomate 'Create an approval', displays the <br> instead converting it in a new line.
blabla70_7-1685110627707.png

 




I need in all places (PowerApps, PowerAutomate) to have new line for each item. Any suggestion?

Thank you
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    <br> is a new line in HTML and there are places where it will automatically convert to a new line character. But if you want to use it as part of a string in a parameter you pass to a flow it should be encoded using Char(10). Char(13) is a carriage return.

     

    Then in Power Automate you can use EncodeURIComponent to get the same character 

    EncodeUriComponent('%0A')

    It works in email because email bodies support HTML.  Emails sent by Approvals don't and have to use a specific markdown language.  Use markdown to format Power Automate approvals - Power Automate | Microsoft Learn

  • blabla70 Profile Picture
    on at

    I have tried both of these syntaxes: 
    Concat(ComboBox.SelectedItems,Value & Char(10) & "<br>") 
    Concat(ComboBox.SelectedItems,Value & Char(10)) 

    The first syntax converts it correctly in Apps and Send email, but not correctly in PowerAutomate 'Create an approval', it still displays the <br>

    blabla70_0-1685127922365.png

     

    The second syntax only  converts in a new line correctly  in  PowerAutomate 'Create an approval',  and it  doesn't get converted in new line in any of the other places (Apps, PowerAutomate 'Send an email (V2)' )

    blabla70_1-1685128702861.png

     


    Any suggestion?

     

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Try using a carriage return and new line.

    Concat(ComboBox.SelectedItems,Value & Char(10) & Char(13)) 
    

    As I mentioned, <br> won't work with Approvals since they don't recognize HTML formatting.

  • developerAJ Profile Picture
    4,643 on at

    Hi @blabla70 

     

    As Pstork mentioned it won't work because email is an html format and approval use markup language. but that's not an issue for your work just use replace function to replace <br> in Approval action.

    replace(variables('Variable'),'<br>','')
     
    Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
  • blabla70 Profile Picture
    on at

    Hi developerAJ,
    it sounds like a good solution, but I am getting the error when trying the following function tin the Inialize variable action:

    replace(variables(triggerBody()['text_6']),'<br>','')

     

    The error: "Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'Template language expression cannot be evaluated: the default fired trigger is not defined at current scope. '.'."

    blabla70_0-1685445408543.png

     

    Is there any syntax error?

    Thanks in advance

  • developerAJ Profile Picture
    4,643 on at

    @blabla70 

     

    use this 

    replace(triggerBody()['text_6'],'<br>','')

     

    or

    Initialize a variable(name: Text) and store triggerBody()['text_6'] .in that case use replace(variables('Text'),'<br>','')

     

    Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • blabla70 Profile Picture
    on at
    Correct it get accepted wihout variables(), thanks. But as a second argument, no character is accepted, ' ' a part.
    So it removes the <br> but doesnt replace it.
    And I would need the second character a to be a new line, or at least other separator. Any idea?
  • developerAJ Profile Picture
    4,643 on at

    use initialise variable 

    name it as varnewline ;type string;

    value field : just click enter so that cursor goes to new line

     

    now use this variable as second argument of replace function in place of ‘’ single quotes

  • Verified answer
    blabla70 Profile Picture
    on at

    Thank you, it works fine!

  • developerAJ Profile Picture
    4,643 on at

    @blabla70 

     

    Please mark this response as Solution

     

    use initialise variable 

    name it as varnewline ;type string;

    value field : just click enter so that cursor goes to new line

    This is final formula:

     

    replace(triggerBody()['text_6'],'<br>',variables('varnewline'))

     

     

    Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard