How to iterate/loop through lookup list OR how to retrieve values from calendar event list

  • 13 June 2018
  • 1 reply
  • 4 views

Badge

I am designing a form about meeting scheduling and a meeting can be scheduled at a given start and end time. I am generating a unique code by combining values from date, time and location the user has selected and saving in calendar list on form save. The problem is i want to check whether the selected time, date and location does not conflict with previously selected time, date and location.

I have created 2 events on same date 6/13/2018 with location2 and location3 as locations and 10am-11am and 1pm-2pm as time repectively. Now I am creating the third event with location as location2, time as 12:30pm-1:30pm and same date as 6/13/2018. I want to retrieve the locations from calendar list using date the user has selected which means i should get location2 and location3. I am using lookup list for that and successfully getting the result but now i want to acess these values using custom javascript so that i can compare the values to check if a meeting can be scheduled or not. 

I have tried using calculated value field and used lookup but it only returns the first value 'location3' and not returning the location2 value

In simpler words, I want to get the values of lookup list in javascript variable one by one. I want to avoid using workflows.


1 reply

Badge +17

I get not wanting to use and workflow, but you are just overcompicating your form 5o avoid using a more robust logic engine such as a workflow to do this for you. Not wrong, just not the easiest and best route.

 

You should be able to use a lookup to return values based on a previsouly entered value. So return any current events for his date range. Then If you see results, show "conflict status", else show "no conflicts found". This may still need some javascript but I think can be done with a calculated field and the list lookup only.

 

Reply