Columns mandatory and moving one sharecomponent under another

sns 9,246 Reputation points
2020-09-16T13:15:01.377+00:00

I have 2 requirements. Please help on this

  1. Whenever anybody enters data in the below "Doctor Appointment" Employee ID and Name should be autofilled by person who entered it.

ex: If I log in Doctor appointment I should see my name and ID in the columns by default? is it possible if yes how? if not are there any alternatives?

  1. Doctor Appointment should go under "Doctor Booking" as per the below screenshot. is it possible?
    it should be like "Doctor Appointment" should be as sub component under "Doctor Booking" is it possible? if yes how? ( I tried quick launching by changing order but it is not working sub component)
    25254-doctorappointment.png

25228-doctobookng.png
2. And under date column for doctor appointment list, they should book only slot for Wednesday and user should able to see available Wednesday slots. is it possible? if yes how?

For more details you can see end user requirement in below screenshot (UserRequirement)
25243-userrequirement.png

Please help me on this. Thank you.

Microsoft 365 and Office | SharePoint Server | For business
0 comments No comments
{count} votes

Accepted answer
  1. Jerry Xu-MSFT 7,961 Reputation points
    2020-09-17T06:36:35.5+00:00

    Hi, @sns ,

    For your requirements, let me provide some solutions one by one.

    1. You want to make the Doctor Appointment link under Doctor Booking. For this, I will suggest you to use structural navigation and modify the links based on your client's requirements. You will need to enable publishing feature and do as this tutorial.

    2. Whenever anybody enters data in the below "Doctor Appointment" Employee ID and Name should be autofilled by person who entered it. As it seems your client is using SharePoint 2016, you can do it with InfoPath or using a Java script.

    InfoPath:

    If you do not want to do any coding, then InfoPath will be your choice. Here are some step-to-step tutorials. I assume the Employee ID is a custom attribute so you will need to do a bit more work to add it. But the process is almost the same:
    https://www.qdoscc.com/blog/how-automatically-retrieve-current-username-infopath-sharepoint-list-form
    https://social.technet.microsoft.com/Forums/azure/en-US/50a74abc-475a-45df-986f-37f2534b3efd/infopath-forms-auto-populate-current-user-details?forum=onlineservicessharepoint

    Script:

    If your client have some developers, then just modify a bit with the script below shall be enough. In the list new form, insert a script editor and add the script.

    Still you need to modify the code a bit to add the employee ID field part. I have attached the script in the txt file.

    Do have a check on the reference: http://www.nocodesp.com/2017/07/auto-populate-sharepoint-list-form-with-user-profile.html[25397-autopopulatecurrentuser.txt][2]

    3. And under date column for doctor appointment list, they should book only slot for Wednesday and user should able to see available Wednesday slots. is it possible? if yes how?

    For out of the box solution, I will recommend you to use column validation. Use the formula below. It only allows users to select upcoming Wednesdays.

    =AND(TEXT(Date,"ddd")="Wed",Date>TODAY())  
    

    Remember to add some information to notify end users.
    25398-image.png

    Update:

    For how to set up the 2 level navigation, please have a check on the below steps:

    1. First we add a heading , set the url to be your url to Doctor Appointments
    25340-image.png

    2. Select the new heading, then add a link under it with the url to Doctor booking.

    25521-image.png

    3. Click OK in the bottom of the page and it shall work now.

    25531-image.png

    For the column validation, please do check the column name. The formula is

    =AND(TEXT(<Field Name>,"ddd")="Wed",<Field Name>>TODAY())  
    

    I tested in my end and it works properly. Do have a check on the formula you use.

    25543-columnvalidation.gif

    And for 20 minutes block, it is no doable out of the box. You will need to use another script to do so.

    For the script, if you have no idea about how to edit the script, please use the InfoPath approach. You will need to check the selector and field name with Devtools. Developing skills are needed.
    25452-empname.gif


    If the answer is helpful, please click Accept Answer and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. sns 9,246 Reputation points
    2020-09-17T06:56:00.02+00:00

    Hi Jerry Xu,

    I have changed the navigation after activating server publishing, but still it is coming "Doctor Appointment" under "Doctor Booking"

    25377-da.png

    But "Doctor Appointment" should be sub link of "Doctor booking"

    something like this,
    25482-ex.png

    and I have done column validation using forumale given by you. it is for "Date" column but below message is coming up

    and is it possible to show 20 minutes slot while booking?
    Please help .

    25350-date.png

    I have used java script given by you on new list form using scirpt editor web part. but still employe name and id is not auto filled.
    I am not clear on where to change the script, can you please give with example on where to change in the code?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.