1

I have a maintenance scheduler list with two inputs: MaintenanceStart (dateTime column) and Status (Choice column)

The predefined value in status column is 'Scheduled maintenance' and I would like to change it to 'Maintenance in progress' after I reach defined time in MaintenanceStart column.

Is it somehow possible with JSON and column formatting?

Thanks!

2
  • Column Formatting can be used to conditionally show the status message. BUT it's only a display value. If you want to actually update a Status field then formatting won't help you. If you can clarify if you are just looking for display customization or an actual update you're much more likely to get the answer you need. Thanks! Jun 23, 2021 at 13:42
  • 1
    It can be also made as a display customization.
    – Martin Dub
    Jun 23, 2021 at 13:47

1 Answer 1

1

If you are going for the display route, you can accomplish this with column formatting!

You can apply this format to any column (it references your column by it's internal name of MaintenanceStart):

{
  "elmType": "span",
  "txtContent": "=if([$MaintenanceStart] >= @now, 'Scheduled maintenance', 'Maintenance in progress')"
}

This is a barebones format for sure (no styling) but that's the basic gist. With this approach the status column is not needed at all since you aren't actually setting a value.

There are tons of other samples that could help you take it further available here: https://github.com/pnp/list-formatting

You can also find a lot of video guidance here: http://bit.ly/lf-videos

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.