User Profile
theChrisKent
MVP
Joined 9 years ago
User Widgets
Recent Discussions
Re: Is it possible to reference a list item value for headerText in actionParams
Xv Yes! You can do this using an expression that builds the escaped JSON needed for the actionParams. It's a bit confusing to look at with all of the escaped quotes, but it works! The actionParams property can be set with an expression. In this case we are going to treat the whole thing like text by surrounding our escaped JSON value with single quotes. Then we can add our dynamic value as part of that text. So we can take your format and adjust the property value to an expression like this: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "button", "txtContent": "Req update", "customRowAction": { "action": "executeFlow", "actionParams": "='{\"id\":\"6876124d-ff27-47df-a446-06b9c64ed95a\", \"headerText\":\"Request update to ' + [$Purpose] + '\",\"runFlowButtonText\":\"Send update request\"}'" } }1.6KViews1like1CommentRe: JSON view and column formatting
lindabusdiecker These are some great ideas! If you are looking for a way to manage files and deployment directly from VS Code, DavidWarner has put together some samples of ways to do this with either PowerShell or the O365CLI. You can find all of that here: (fair warning, that, while powerful, it's definitely much more in the realm of development. But if things get daunting, David or I would be happy to help): https://github.com/SharePoint/sp-dev-list-formatting/tree/master/tools/general-dynamic-deployment-with-vscode Your suggestion of providing out of the box interfaces to generate the JSON is a great one and one that Microsoft is actively working on. You'll see it in action on certain column types (datetime, choice, yes/no and a few others) and it's called Design Mode: https://www.youtube.com/watch?v=0sR7peVBNPk&list=PLR9nK3mnD-OXgMjDBdjWUTRia89oixBhx&index=14&t=0s These are somewhat simplistic now but much more is coming in the future. The team demoed it at SPC last May and it should be pretty awesome. Hoping to see more about that soon. You can implement comments in your JSON file by simply adding an attribute and setting the value. It's not super intuitive and could be better but it can be far better than forgetting how something works later. Fortunately, these values are totally ignored by the formatting engine and so they don't cause any problems. Here's a simple example: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "Hey there!", "comment": "Totally useless format that just shows 'Hey there!', Wowee!" } The use of "comment" above is totally arbitrary (you can use whatever key you want). I too would like to be able to reference a file for my formatting (similar to JS Link)! But in the meantime here are a couple of tips that I use: Site Columns can contain formats and this makes for a more centralized place to use them across your site collection. If a user changes the format on a list field you can simply update the site column and have it push down it's changes. PnP Provisioning templates fully support column and view formats. You can extract a template of your site and reapply at any time. Formats can be applied via PowerShell and the O365CLI (see above for examples) so writing centralized deployment scripts is fully possible You can find other tips/demos here: https://www.youtube.com/playlist?list=PLR9nK3mnD-OXgMjDBdjWUTRia89oixBhx6.3KViews3likes2CommentsREST equivalent of Field.UpdateAndPushChanges
The Client Side Object Model has a method UpdateAndPushChanges for fields. This allows you to both update a site column AND all the lists where the site column is being used. Is there a REST equivalent? I can update a site column just fine, but I can't seem to find a way to propagate those changes to the list(s). Hopefully, I'm just missing something obvious. Thanks!940Views0likes0CommentsRe: Permission Inheritance on a new folder
When you add a folder through the UI, the default is to inherit permissions from the parent (folder, list, site, etc. depending on where the first unique permissions are found). There is no way to change this default behavior (however, you could set the default of the parent to just admin permissions and then adjust the folder as necessary). If you are creating these folders programattically, there are APIs to break inheritance and then adjust the permissions and is relatively straightforward to do.7.8KViews1like1Comment
Recent Blog Articles
No content to show