1

I am a beginner of SharePoint. I want to create a calendar form to use it as a team members out of office info, a meeting request to a manager, etc.

The form includes; Name, Title, Start/End Time and Category. Under Category, there are options such as "Out of office", "Meeting Request", "Holiday" etc.

If a member selects "Meeting Request", I want to show 4 additional columns in the form.

These 4 should be hidden until "Meeting Request" is selected from drop down list.

  1. Meeting Type
  2. Document Prepared By
  3. Document Reported By
  4. Purpose of the Meeting

Could someone please help me with column formatting code and where to add these codes?

1
  • Are you using SharePoint Online modern experience lists & forms? Apr 29, 2021 at 15:27

2 Answers 2

0

This is way late, but one thing you might consider is to have two different content types for your list by adding a custom content type (intro to content types: https://support.microsoft.com/en-us/office/introduction-to-content-types-and-content-type-publishing-e1277a2e-a1e8-4473-9126-91a0647766e5).

You could have two content types, one which has the regular information and a second which has that information plus the additional four fields.

This doesn't require any programming, but you do have to design level permission for the list to add a content type (https://support.microsoft.com/en-us/office/add-a-content-type-to-a-list-or-library-917366ae-f7a2-47ad-87a5-9689a1884e60).

The downside is that there will be some training involved to have people pick the right content type when creating the original list item or when switching between content types.

0

If you are using SharePoint online modern experience, you can achieve this using conditional formulas.

You can use formula like:

=if([$Category] == 'Meeting Request', 'true', 'false')

Steps to add conditional formulas:

  1. Go to the list where you want to show or hide columns in the form.

  2. Open an item to view the item details in the display form OR open the new list item form.

    enter image description here

  3. Click on Edit form icon at the top, then select Edit columns.

    enter image description here

  4. Navigate to the desired column for which you want to set a conditional formula (your 4 additional columns)

  5. Select the far right hand edge of the column name to display the options menu (...)

  6. In the more options, select Edit conditional formula.

  7. In the Edit conditional formula dialog, specify a conditional formula like above

  8. When you are finished, select Save.

    enter image description here

  9. Repeat the same steps for all 4 columns.

Important Points:

  1. Do not make 4 additional columns as required
  2. In conditional formulas, you have to use internal name of your columns. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?

Documentation: Show or hide columns in a list or library form

4
  • Thank you very much for your help! I am trying to follow your instruction, but I don't see "Edit Conditional Formula". I can go to Calendar -> List settings -> Columns -> Edit columns and see "Column formatting" box in the bottom saying "Change the display of this column by adding JSON below. When I add the code you provided me above into this box, nothing happens. Could you help me how to make it work? Thank you very much.
    – Rachel
    Apr 29, 2021 at 17:32
  • Are you using "modern experience" custom list or classic experience "Calendar" type list? You don't need to go to list settings. you can select "new" form within list. check images in updated answer. Apr 29, 2021 at 17:33
  • How can I tell which one I am using (Modern or Classic)? When I click "New Event" in the calendar, I can create a new event in the calendar but I don't have an option to edit the form.
    – Rachel
    Apr 29, 2021 at 17:59
  • Also I don't have a permission to use Sharepoint Designer. It is restricted by the IT dept in my company.
    – Rachel
    Apr 29, 2021 at 18:01

Your Answer

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

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