cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Forms + Adaptive card in Teams: How to make an empty line?

Hi,

I wanted to post an adaptive card in a Teams channel as soon as I get a new response on my form.

I managed it to replace \n with \n\n to display the paragraphs correctly using this method: https://powerusers.microsoft.com/t5/Building-Flows/Filter-certain-characters-out-of-a-Forms-answer/...

But empty lines

 

like this one above won't work.

I tried to make a filter that replaces \n\n with \n\n-\n\n, to make a - instead of the completely empty line. But it doesn't work.

Has anyone got an idea how to fix this?

Thanks in Advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

hi @tomjedig  please follow this example to see how to delete line breaks I'm shure this could help you

 

show.PNG

 

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

@tomjedig  %0A means line break you add %0A as you what to add a line break then you can convert it with decodeUri



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

12 REPLIES 12
Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

hi @tomjedig  you can replace a white space using %20 with encodeUriComponent expression. or just try replace(YOURDATA,' ', '-')



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

hi @ChristianAbata,

I did it with the guide you sent me in the other post.

I think it's too hard to make separate filters for \n and \n\n.

I will probably just add some info in Forms about this. Anyway, thanks 🙂

Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

Ugh god, I forgot to save when it worked with just a normal paragraph.

@ChristianAbata could you maybe look over it and tell me what I did wrong? It should just replace the \n with \n\n to make a new line in the adaptive card, but it doesn't.

2020-05-24_17-26-24.png2020-05-24_17-26-37.png

The createArray is createArray('\n') and the replace is replace(variables('Sanitise'), item(), '\n\n')

 

I really don't know what I did wrong. The filtered text in the adaptive card part just says \ instead of \n\n 😞

 

2020-05-24_17-31-47.png

Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

@tomjedig  could you paste here the output inside action verffaseen filtered please



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

this should be line 1
this should be line 2
and this should be line 3

 

Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

@ChristianAbata I re-built the flow now and tested it with

line one
line two
line three

empty line

 as answer, this time it didn't do anything. I'm posting this screenshot because you can see the \n stuff here.

2020-05-24_17-50-13.png

Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

thnk you @tomjedig  now please I need what is inside body in teams action please



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

That's what I put in when I built the flow:

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "size": "ExtraLarge",
            "weight": "Bolder",
            "text": "@{body('Antwortdetails_abrufen')?['r8b3504d066d94a46b226ed74032b1a2e']} - @{body('Antwortdetails_abrufen')?['r19084fc112b74c5b921179fefd75cbf3']}"
        },
        {
            "type": "TextBlock",
            "text": "Die Aufgabe ist möglichst bis zum @{body('Antwortdetails_abrufen')?['r94b1bade43664955bce9cfef5e14ba2c']} zu bearbeiten."
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": "auto",
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "Arbeitsauftrag",
                            "size": "Large",
                            "fontType": "Default",
                            "weight": "Bolder"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "id": "chevronDown1",
                    "spacing": "Small",
                    "verticalContentAlignment": "Center",
                    "items": [
                        {
                            "type": "Image",
                            "selectAction": {
                                "type": "Action.ToggleVisibility",
                                "title": "collapse",
                                "targetElements": [
                                    "cardContent1",
                                    "chevronUp1",
                                    "chevronDown1"
                                ]
                            },
                            "url": "https://adaptivecards.io/content/down.png",
                            "width": "20px",
                            "altText": "collapsed"
                        }
                    ],
                    "width": "auto"
                },
                {
                    "type": "Column",
                    "id": "chevronUp1",
                    "isVisible": false,
                    "spacing": "Small",
                    "verticalContentAlignment": "Center",
                    "items": [
                        {
                            "type": "Image",
                            "selectAction": {
                                "type": "Action.ToggleVisibility",
                                "title": "expand",
                                "targetElements": [
                                    "cardContent1",
                                    "chevronUp1",
                                    "chevronDown1"
                                ]
                            },
                            "url": "https://adaptivecards.io/content/up.png",
                            "width": "20px",
                            "altText": "expanded"
                        }
                    ],
                    "width": "auto"
                }
            ]
        },
        {
            "type": "Container",
            "id": "cardContent1",
            "isVisible": false,
            "items": [
                {
                    "type": "Container",
                    "items": [
                        {
                            "type": "TextBlock",
                            "isSubtle": true,
                            "text": "@{outputs('Verfassen_2')}",
                            "wrap": true
                        }
                    ]
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "ActionSet",
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "In Planner öffnen",
                            "url": "https://www.office.com/?auth=2"
                        },
                        {
                            "type": "Action.OpenUrl",
                            "title": "Zu den Dateien",
                            "url": "https://www.office.com/?auth=2"
                        }
                    ]
                }
            ]
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.2",
    "fallbackText": "This card requires Adaptive Cards v1.2 support to be rendered properly."
}

And this is what I got when I tested it:

{
  "recipient": {
    "to": "my email"
  },
  "messageBody": "{\n    \"type\": \"AdaptiveCard\",\n    \"body\": [\n        {\n            \"type\": \"TextBlock\",\n            \"size\": \"ExtraLarge\",\n            \"weight\": \"Bolder\",\n            \"text\": \"legga schmegga eis - sgr\"\n        },\n        {\n            \"type\": \"TextBlock\",\n            \"text\": \"Die Aufgabe ist möglichst bis zum 2020-05-03 zu bearbeiten.\"\n        },\n        {\n            \"type\": \"ColumnSet\",\n            \"columns\": [\n                {\n                    \"type\": \"Column\",\n                    \"width\": \"auto\",\n                    \"items\": [\n                        {\n                            \"type\": \"TextBlock\",\n                            \"text\": \"Arbeitsauftrag\",\n                            \"size\": \"Large\",\n                            \"fontType\": \"Default\",\n                            \"weight\": \"Bolder\"\n                        }\n                    ]\n                },\n                {\n                    \"type\": \"Column\",\n                    \"id\": \"chevronDown1\",\n                    \"spacing\": \"Small\",\n                    \"verticalContentAlignment\": \"Center\",\n                    \"items\": [\n                        {\n                            \"type\": \"Image\",\n                            \"selectAction\": {\n                                \"type\": \"Action.ToggleVisibility\",\n                                \"title\": \"collapse\",\n                                \"targetElements\": [\n                                    \"cardContent1\",\n                                    \"chevronUp1\",\n                                    \"chevronDown1\"\n                                ]\n                            },\n                            \"url\": \"https://adaptivecards.io/content/down.png\",\n                            \"width\": \"20px\",\n                            \"altText\": \"collapsed\"\n                        }\n                    ],\n                    \"width\": \"auto\"\n                },\n                {\n                    \"type\": \"Column\",\n                    \"id\": \"chevronUp1\",\n                    \"isVisible\": false,\n                    \"spacing\": \"Small\",\n                    \"verticalContentAlignment\": \"Center\",\n                    \"items\": [\n                        {\n                            \"type\": \"Image\",\n                            \"selectAction\": {\n                                \"type\": \"Action.ToggleVisibility\",\n                                \"title\": \"expand\",\n                                \"targetElements\": [\n                                    \"cardContent1\",\n                                    \"chevronUp1\",\n                                    \"chevronDown1\"\n                                ]\n                            },\n                            \"url\": \"https://adaptivecards.io/content/up.png\",\n                            \"width\": \"20px\",\n                            \"altText\": \"expanded\"\n                        }\n                    ],\n                    \"width\": \"auto\"\n                }\n            ]\n        },\n        {\n            \"type\": \"Container\",\n            \"id\": \"cardContent1\",\n            \"isVisible\": false,\n            \"items\": [\n                {\n                    \"type\": \"Container\",\n                    \"items\": [\n                        {\n                            \"type\": \"TextBlock\",\n                            \"isSubtle\": true,\n                            \"text\": \"one\ntwo\nthree\n\",\n                            \"wrap\": true\n                        }\n                    ]\n                }\n            ]\n        },\n        {\n            \"type\": \"Container\",\n            \"items\": [\n                {\n                    \"type\": \"ActionSet\",\n                    \"actions\": [\n                        {\n                            \"type\": \"Action.OpenUrl\",\n                            \"title\": \"In Planner öffnen\",\n                            \"url\": \"https://www.office.com/?auth=2\"\n                        },\n                        {\n                            \"type\": \"Action.OpenUrl\",\n                            \"title\": \"Zu den Dateien\",\n                            \"url\": \"https://www.office.com/?auth=2\"\n                        }\n                    ]\n                }\n            ]\n        }\n    ],\n    \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\n    \"version\": \"1.2\",\n    \"fallbackText\": \"This card requires Adaptive Cards v1.2 support to be rendered properly.\"\n}"
}

 

Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

hi @tomjedig  please follow this example to see how to delete line breaks I'm shure this could help you

 

show.PNG

 

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

Hi @ChristianAbata I want to add an extra line break, not delete it.

When I put the normal answer with one line break in, the adaptive card doesn't have the line break, it has just a space.

But if I put two line breaks in, the text gets a new line in the card.

So I want to replace every line break with two line breaks, how can I do that?

Highlighted
Super User III
Super User III

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

@tomjedig  %0A means line break you add %0A as you what to add a line break then you can convert it with decodeUri



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Highlighted
Helper I
Helper I

Re: Forms + Adavptive card in Teams: Multiple paragraphs?

Ah ok @ChristianAbata thank you!
It replaces %0A or with %0A%0A 🙂

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (3,667)