Challenging Lookup Help Needed

I have a repeating group that is a lookup of “Job Listings”, each Job Listing has a Start Time and End Time, that Users can select to pick up shifts. After the user selects a shift, they are the “assigned to” user for that shift. What I need to do is disable the “Select” button if the Current User has a shift End Time within 2 hours of the Current Cell Start Time. How do I do this ? Any help would be greatly appreciated.

Is the button in the repeating group? If so, I think you could accomplish this pretty easily by putting a condition with just this on the button:

Before I get to Jason… @mac2, if you’re right and this one is way easier than the 90 minutes or so that it took me to figure something out, I’m going to feel pretty damn stupid. So, be gentle, please. :slight_smile:

Hi there, @jason.h… to mac’s question, I assumed the button is in the repeating group, and I believe I have something that produces the desired result. Here is the condition that appears to do what you described…

Note that there is a constraint on the condition’s Search for Job Listings where assigned to = Current User. And yes, I know it’s weird that I am looking for a number between 0 and -3, but I tried configuring the overall expression and associated filters in every imaginable way, and this configuration is the only one I could get to work.

For what it’s worth, the first condition in the screenshot hides the button if the current user is already assigned to a job listing, and the third condition (which I can screenshot if you want) disables the button if the current user is assigned to a job listing where the start/end time range contains either the start time or end time of the current cell’s job listing.

Anyway, maybe I’m way off on this one and I overcomplicated it in a galactically stupid way, but it’s what I’ve got, and I hope it helps.


1 Like

@mikeloc @mac2 Let me try to provide some more clarification on where I am getting stuck.

  • Below is a lookup that displays a list of jobs that are available to be selected by a user. Most of the criteria are filters that the user can select.

  • A user can have multiple jobs already claimed at any point in the future and the jobs can be any point in the future.

  • There is a button on each job post, see below, for the user to claim a new job. However, this button needs to be disabled if the user already has a current job that ends within 2 hours of a start time of a job they already have claimed. This is the part that I am getting stuck on. How do I have each posted job, in the RG, check each claimed job of the user?

Screen Shot 2022-09-17 at 5.19.32 PM


Um, did you even look at my reply? :wink:

Yes I did. Maybe I am not understanding it completely but it appears that your filter compares the current cell job to just 1 assigned job not all of the user’s upcoming jobs.

Well, it doesn’t do that, but I already put way too much time into this one, so I’ll step back and let others help out here… best of luck.

1 Like

Try something like this for a conditional on your button, a variation of this works for me:

When Search for Job Posts: filtered: count > 0
This element is clickable = no

User Assigned = current user
Any other constraints you might need?

Filtered By:
Advanced: This Job Posts Start Date <-range-> This Job Posts End Date + 2 hours overlaps with Current Cell’s Job Post Job’s start date ← range - > Current Cell’s Job Post end date

Yup, exactly the same concept, but that filter makes a lot more sense than the one I came up with… nice, @ratsoundsystems.