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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Use value of column in...
Power Automate
Answered

Use value of column in Json Formatting

(0) ShareShare
ReportReport
Posted on by 73

I have a column (Review and Approval) which shows a button if the value is Start Workflow, and clicking it opens a flow in Power Automate. In the example below the ID of the power Automate Flow is 0123456789 (See below: Json code column Review and approval:) .

I need to have the result of a choice column instead of 0123456789. See below what I've tried (Idea I tried:).
I added a column Approval_Flow_ID, and replaced 01234567879 with [$Approval_Flow_ID], but the button doesn't show.
Any Idea's? THANXX

Json code column Review and approval:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "@currentField",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"01234567890"}"
},
"style": {
"background-color": "#008082",
"color": "white",
"border-radius": "0 15px",
"visibility": "=if((@currentField == 'Start Workflow'),'visible','hidden')"
}
}

Idea I tried:
Json code column Review and approval:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "@currentField",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"[$Approval_Flow_ID]"}"
},
"style": {
"background-color": "#008082",
"color": "white",
"border-radius": "0 15px",
"visibility": "=if((@currentField == 'Start Workflow'),'visible','hidden')"
}
}

rolanddaane_0-1640242056850.png

 





Categories:
  • leo85 Profile Picture
    635 on at

    Hi @rolanddaane ,

    to me this question may better be posted in a SharePoint forum, but I'll give it a try.

     

    Is the column "Approval_flow_ID" visible? In column formatting you can only access those columns that are currenly visible in the table. So if you have hidden the column "Approval_flow_ID", the other column cannot access it.

     

    Additionally, you have a syntax error in your code. After "[$Approval_Flow_ID]" there is backslash missing. It should read '\"[$Approval_Flow_ID]\"'.

     

    leo85_0-1640250694804.png

     

     

    Regards,

    Leo

     

    ---------------------------------------------------

    If my answer solved your issue, please mark it as complete.

    If what I wrote helped you, please give it a thumbs up.

  • Verified answer
    rolanddaane Profile Picture
    73 on at

    I indeed didn't have it visable.
    I'll try putting the Flow ID into the column that presents the button. If I format the color of the text the same as the body it should work.

    I don't want to have the select column for the flow active because general users won't require it, and may switch off.

    Thanks!

  • OliverR-82 Profile Picture
    623 on at

    Hi @rolanddaane , did you get this working? I am facing the same scenario where I want to trigger a different flow from a button, based on the column value that contains the flow ID (@currentField).

     

    I'm struggling to get the syntax right.

  • OliverR-82 Profile Picture
    623 on at

    After a bit more searching online I managed to get it working. The correct syntax for the customRowAction property is the following, in my case:

     

    "customRowAction": {
     "action": "executeFlow",
     "actionParams": "='{\"id\": \"' + @currentField + '\"}'"
    }

     

    I was struggling to put it all together, and forgot the '=' sign. I hope this helps someone.

  • rolanddaane Profile Picture
    73 on at

    I tried that but that throws an unexpected end of Json error

  • rolanddaane Profile Picture
    73 on at

    Because I want to take the value from the column Approval_Flow_ID (and not @currentField, I need something like this....

    "customRowAction": {
    "action": "executeFlow",
    "actionParams": "='{\"id\": \"' + [$Approval_Flow_ID] + '\"}'"
    }

  • OliverR-82 Profile Picture
    623 on at

    Hi @rolanddaane 

     

    Funnily enough I was experimenting with just that scenario earlier this week. I got it to work with the following code, which looks to be exactly the same way as what you pasted. Just make sure that you're using the internal column name to reference the field (in my case it was 'FlowID')

     

     

    "customRowAction": {
     "action": "executeFlow",
     "actionParams": "='{\"id\": \"' + [$FlowID] + '\"}'"
     }

     

    If you're getting an "unexpected end of JSON" error maybe the problem lies elsewhere (forgot a comma, closing bracket or parentheses...).

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard