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

Community site session details

Session Id : 28yDnvzl1MLXvGIPOC+kfw
Power Automate - Building Flows
Unanswered

Building a String in Atlassian Document Format but Power Automate Recalcitrant JSON error

Like (0) ShareShare
ReportReport
Posted on 1 Mar 2024 00:16:14 by 4

The Power Automate Jira Operations "Get Issue" and "Edit Issue" unfortunately, for unreasons, the "Get Issue" returns a text field with simple links in the form "[DisplayedUrl|RedirectUrl]", while the "Edit Issue" requires the same field to be in Atlassian Document Format.

 

I'm forced to rebuild a string in Atlassian Document Format. My Kingdom for the ability inject some script (Python, PowerShell, SQL) or code (C#, Java, VB6 even), but, again for unreasons, Power Automate forces me the structure a String Builder in UI components, instead of Code or Script. It's insane.

 

So, ultimately the problem is, I'm trying to build this string builder using these jank UI components. I'm trying to use a "Set (String) Variable" or "Append String Variable" with text like the following. But I can't save the Flow because Power Automate complains "Enter valid json." But why? It's not json. I don't want it to be json. It's just a string. I'm just trying to save a string. Why won't it just save, Power Automate? How do I get Power Automate to ignore this ridiculous "Enter valid json." error and just save?

{
"type": "text",
"text": "Documents: @{items('Apply_to_each_-_Existing_Documents_Array_-_Markup_and_set_Existing_Documents')['SubmittedDTTM']}"
},
{
"type": "hardBreak"
}

  • v-yueyun-msft Profile Picture
    on 01 Mar 2024 at 03:30:12
    Re: Building a String in Atlassian Document Format but Power Automate Recalcitrant JSON error

    Hi , @shanerowley-ds 

    Thanks for your reponse!

    I'm sorry, but this is really annoying for not being able to enter text directly. We can only try to solve this problem. You can try using the concat() function in flow, I hope it works.

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • shanerowley-ds Profile Picture
    4 on 01 Mar 2024 at 03:20:29
    Re: Building a String in Atlassian Document Format but Power Automate Recalcitrant JSON error

    My head is spinning. Attempting to use concat(), just makes this whole builder the most error prone, complicated thing I've ever seen. Even if I somehow get this to work, it will be impossible to maintain.

     

    This is such a disaster. No one would ever consider building such an abomination. I could build this thing in script within an hour or two. But Power Automate, I don't even understand why someone would release this monstrosity upon society. So clunky. So very, very clunky. And it's all caused by these janky Jira Edit and Get commands that are in conflict with one another. It would surely be easier if Microsoft open-sourced these janky Jira connectors and I just went in a fixed the bugs myself.

  • v-yueyun-msft Profile Picture
    on 01 Mar 2024 at 01:41:28
    Re: Building a String in Atlassian Document Format but Power Automate Recalcitrant JSON error

    Hi , @shanerowley-ds 

    I test it in my side , in power automate , if you use the []  will identify it an array  , {} will  identify it an object. So if you use the [] or {} , you need to have a invalid json in some condition.

    vyueyunmsft_0-1709257038936.png

     

    If you just want to append the string, you can try to use concat() code like this:

    vyueyunmsft_1-1709257079795.png

    concat('{"type":"text",','"text": "Documents' ,string(outputs('Compose')) , '"' ,'},{"type":"hardBreak"}' )

     

    concat('{"type":"text",','"text": "Documents:' ,string(items('Apply_to_each_-_Existing_Documents_Array_-_Markup_and_set_Existing_Documents')['SubmittedDTTM']) , '"' ,'},{"type":"hardBreak"}' )

    And use this concat() function, you can avoid to add the \n in your string.

     

    And the result is as follows:

    vyueyunmsft_2-1709257141960.png

    The double-quoted escape character is what is required for presentation in Power Automate, and when you refer to this value again, it will not generate the escape character.

    As you can see the "Compose 2" action output:

    vyueyunmsft_3-1709257246315.png

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

  • shanerowley-ds Profile Picture
    4 on 01 Mar 2024 at 01:07:59
    Re: Building a String in Atlassian Document Format but Power Automate Recalcitrant JSON error

    Bizarre error when appending a string

    shanerowleyds_5-1709254785858.png

     

     

    String Variable

    shanerowleyds_0-1709254550464.png

     

    Trying Build the ADF string

    shanerowleyds_1-1709254577764.png

    shanerowleyds_2-1709254595346.png
    shanerowleyds_3-1709254605417.png

     

    Bizarre unintended output when running the Flow. Power Automate is doing multiple things wrong. All the indentation of ADF markup gets removed in the append steps, just by saving the Flow. The 'ExistingDocuments' in the compose step is encased in quotes for unknown and irrational reasons. All the NewLines were replaced with \n, which I didn't do and is undesired. All Quotes are escaped \" for unknown and irrational reasons. 

     

    shanerowleyds_4-1709254669514.png

     

  • v-yueyun-msft Profile Picture
    on 01 Mar 2024 at 00:48:39
    Re: Building a String in Atlassian Document Format but Power Automate Recalcitrant JSON error

    Hi , @shanerowley-ds 

    According to your description, you are using the "Set (String) Variable" or "Append String Variable" to set the text but it show the error "invalid json". Can you try to use the string() function to force the code to string type first?

     

    If I misunderstand what you mean,can you show the screenshot of your flow how you put this code in your side:
    {
    "type": "text",
    "text": "Documents: @{items('Apply_to_each_-_Existing_Documents_Array_-_Markup_and_set_Existing_Documents')['SubmittedDTTM']}"
    },
    {
    "type": "hardBreak"

    }

     

    Best Regards,

    Yueyun Zhang

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2