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 :
Power Automate - Building Flows
Answered

Add Custom Format to a Sharepoint Column when creating it through Power Automate

(0) ShareShare
ReportReport
Posted on by

Hey everyone. I'm creating a bit of a complex flow to do some calculations in a Sharepoint list.

 

I'm having a problem when trying to set a custom JSON format in a column I'm creating with an HTTP call. There are no errors if I try to create the column without any formatting. So I think it has to be in the property I'm assigning the style to or the JSON itself (but it works great If I add it manually to the column through Sharepoint).

 

Here is a screenshot of the HTTP call:

Valero_1-1647175239603.png

 

I'll keep trying in the meantime and post any updates. 

 

If you need more information just let me know and I will provide it.

 

Thanks in advance

 

 

I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    Re: Trying to set a Custom Format to a new Sharepoint Column

    After a bunch of trial an error, I found out the solution. 

     

    The problem here was with the JSON itself. It needs to be as a string, here is the result call:

     

    2022-03-14_11h45_24.png

     

    Spoiler (Highlight to read)
    "{\"$schema\":\"https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json\",\"elmType\":\"div\",\"children\":[{\"elmType\":\"span\",\"txtContent\":\"@currentField\",\"style\":{\"padding-left\":\"8px\",\"white-space\":\"nowrap\"}}],\"attributes\":{\"class\":\"sp-css-backgroundColor-BgCornflowerBlue sp-css-borderTop-CornflowerBlueFont\"},\"style\":{\"padding\":\"0\",\"width\":\"=if(@currentField >= [$Capacity], '100%', (@currentField / [$Capacity]) * 100 + '%')\"}}"
    "{\"$schema\":\"https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json\",\"elmType\":\"div\",\"children\":[{\"elmType\":\"span\",\"txtContent\":\"@currentField\",\"style\":{\"padding-left\":\"8px\",\"white-space\":\"nowrap\"}}],\"attributes\":{\"class\":\"sp-css-backgroundColor-BgCornflowerBlue sp-css-borderTop-CornflowerBlueFont\"},\"style\":{\"padding\":\"0\",\"width\":\"=if(@currentField >= [$Capacity], '100%', (@currentField / [$Capacity]) * 100 + '%')\"}}"
  • gianmasmec Profile Picture
    2 on at
    Re: Trying to set a Custom Format to a new Sharepoint Column

    Great solution. Could you provide an alternative for choice fields?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard