If you have already wanted to create some dynamic fields into the SharePoint item form in accordance with the selected value from another field, you have often been forced to use Microsoft Power Apps due to this kind of use case... How about if I tell you that for some very simple use cases, it is possible without Power Apps?

Almost every week, sometimes during several days, Microsoft rolls out new features for SharePoint Online and other Microsoft 365 services. It is not easy to follow all new features and sometimes the smallest ones can become really useful like the update feature Conditionally show or hide columns in a SharePoint list or library form.

Until now, when you wanted to configure which column had to be displayed in accordance with a value from another field, the only choice was to use Power Apps.

Customize a SharePoint list form - Power Apps
Use Power Apps to customize the form with which users create and update entries in a SharePoint list.

Here an example of a use case:

  • A mandatory column of type Choice named Provider. The choices are:
    • Microsoft
    • PnP Community
  • A column of type Choice named MSProducts. List of several Microsoft 365 services
  • A column of type Choice named PnPProducts. List of several products provided by the PnP Community
  • When the Microsoft value is selected from the Provider column, the MSProducts field has to be displayed and the PnPProducts hidden
  • When the PnP Community value is selected from the Provider column, the PnPProducts field has to be displayed and the MSProducts hidden

Steps of configuration

  1. Create a new item to the list
  2. Once created, open the display panel by clicking on the title (by default)
  3. From the header of the panel, expand Edit form and click on Edit columns
  1. From the panel of columns, hover onto the target column (MSProducts) and click on the ellipsis
  2. Click on Edit conditional formula
  1. From the dialog, enter the following formula: =if([$Provider]== 'Microsoft', 'true', 'false')
  2. Click on Save
  1. Edit the Conditional Formula of the other column (PnPProducts)
  2. Enter the following formula: =if([$Provider]== 'PnP Community', 'true', 'false')
  3. Click on Save
  4. Click Save from the panel

For those who are curious and want to know why we are currently editing the Display form rather than the Edit form, I do not have any logical explanation πŸ€·πŸΌβ€β™‚οΈπŸ™„πŸ˜†

Before writing this post, I tried to configure the Edit form but the formulas were not valid...

MC211640: Conditionally show or hide columns in a SharePoint list or library form
After several attempts to operate a conditional field on item form, the formula still invalid. The use case is the following one: 1 column Provider, type Choice with 2 values 2 other columns msProducts and pnpProducts, type Choice When the provider is equals to Microsoft, the column msProducts shou…

From now on, if you create a new item, in accordance with the selected value from the Provider field, the MSProducts or PnPProducts will appear and all without a Power Apps form. How cool is that? 😁πŸ’ͺ🏻

SharePoint show/hide columns in list form demo
[note]Note

If you select a first provider and choose a MSProduct then change the provider and select a PnPProduct, both will be defined when you save the item.

Reference:

Show or hide columns in a list form
Customize which columns to show or hide using a conditional formula in the list form by constructing a simple formula that are equations performing conditional checks on values in a SharePoint list or library.

[note]Note

All column types are supported except:
- Person columns with multiple selections
- Time calculations in DateTime column
- Currency columns
- Location columns
- Calculated columns
- Managed Metadata columns

Hoping this post will help you πŸ˜‰

You may also be interested in