1

Quick question - I have 2 lists: ListA and ListB On ListA user can create multiple entries with their absence plan. Their choice is saved to field XXX as number. ListB contains value with granted days to use.

How can I calculate on [ListA or ListB] how many days user has left? [Granted - XXX] and show this to user?

I can link between those lists based on ListA=CreatedBy and ListB=EmployeeMail

Thanks!

1
  • 1
    Hi, Try using the lookup field type. List B contains the user's available days of holiday. List A contains multiple entries (representing each holiday they take). Create the look-up field in List A. Then create a calculated field in List A, it will subtract the # days holiday taken from the # days holiday allowance.
    – Tally
    Commented Jan 22, 2018 at 14:54

1 Answer 1

0

You can use a Workflow. When an item is created in ListA, automatically start the workflow to update vacation remain days.

  1. Create a list workflow for LIstA and start it automatically when an item is created.
  2. In the workflow, retrieve the specific granted days from ListB where the Employee is equal to Created By of the current item.

  3. Calculate granted days minus absence day using Do Calculate action.

  4. Update one column with this value.

Another workaround, use the Event Receiver to monitor the events in the ListA. The code/operations in an event receiver can be triggered when an item is created/modified/deleted in ListA.

As you are using the SharePoint Online, you need to create a Remote Event Receiver.

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/create-a-remote-event-receiver-in-sharepoint-add-ins

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.