Update User if certain Relationship pairs exist

Hello, I have a many to many relationship between Users and Sessions. I want to update a boolean value called Conflict if the user selects certain Sessions. Example If a user selects sessions 1 and 2 or 5 and 6 then set Conflict to true. The user selects sessions by a toggle box from a list. I would greatly appreciate any advice, thank you!

Hi @anthony.soileau ,

Welcome !

We need to look at your collections and your toggle actions.

The more comprehensive the better.






Thanks for the quick reply!

Here are some screenshots of what it looks like. I want to check if the User has certain pairs of SessionIDs and if they do to update the Conflict Boolean to true. I would like to add the action whenever they schedule a session via the toggle, but if I had to make a separate button for it then that would still be very helpful.

I am a teacher and I made this app for my district to allow teachers to schedule professional developments during the summer. Right now I have some teachers signed up for sessions that overlap and would like to be able to notify them via a sometimes visible text and more importantly notify myself. I am going through manually right now, but would really like to automate the process. Thanks again!

Thanks for the follow up explanation.

I think we need to define the database first.

So, users select test presenters then select session id, and then you want a bool conflict turned true when session ids are duplicate ?

I don’t think it is the correct workflow.

What your session id look like in real life ?

How is test presenters come in to this process ?

Thanks for your patience! Let me define all of my collections:
TestSession: Information about content being presented, could be on multiple dates/times. many to many TestPresenter; many to one sessionID
TestPresenter: information about the presenters, many to many TestSession. Many to Many SessionID; [probably redundant since I could get that information from the TestSession.]
SessionID: Unique date time of each session being presented. one to many TestSession, Many to Many TestPresenter, Many to Many Attendees (users)

TestSession and TestPresenter are just for different screens to display information about the sessions and link to pages to sign up for a SessionID through a toggle on a list.

SessionID has an arbitrary and unique number for each of our 32 sessions. It has a relationship with a TestSession and takes the same title as the TestSession [redundant, but it helped me make the relationships]. Each sessionID has a single date/time it will be presented where as the same TestSessions could have multiple. The location is the building that it will be presented in. TestPresenters are all of the different presenters that will be at that TestSession, [again probably redundant]. The meet Link is for virtual sessions’ google meet/zoom links, and Duration is how long it will last in minutes.

Some sessionIDs are for the same TestSession, let’s say 14 and 15 are the same TestSession; I want to change the bool Conflict to true if the user signs up for both. Also, some sessions occur at the same time so I would again want to change Conflict to true for the user.

Users can look at TestPresenters and TestSessions to decide what SessionIDs they want to sign up for, but Users have no relationships with those two collections.
Thanks again!

I have made example app here,
Pro Dev for Teacher (adalo.com)

It is cloneable, so you can check the relationship.

What does the conflict means ?

Conflict would mean the User has selected 2 (or more) SessionIDs in which they are not allowed to go to both. Either they are the same TestSession or occur at the same time.

The logic would be something like this for the Logged In User:
If User selects [(SessionID 1 AND Session ID 2) OR (SessionID 1 AND Session ID 6) OR (SessionID 14 AND SessionID 15)]
Then Conflict = True

I’ve been tinkering with the custom actions. I was thinking if I make a custom action to get the user’s sessionIDs and then another custom action that runs sometimes based on the sessionIDs of the user and sets conflict to True. Having trouble setting up the custom action though.

I keep getting a 404 error


You need to read docs for this and make sure the key is correct.

It should be formulated, not arbitrary like this.

You might want to share real life example as the answer could be in front of us.

Ok, so I got the custom action to work. I had to remove the /1 from the end of the API key. However, I can’t use the SessionIDs that I get for the next custom action. I can see the string, numerical and boolean data but not the array for SessionIDs. Is it possible to get an array? I also don’t see the option of array when making inputs for a custom formula. Is it possible to use methods inside of the Body when creating a custom action? I was going to use JSON.stringify(); but it said “Please enter a valid JSON body”.

real example:
User signs up for “eSports” on Monday (sessionID 14) then user signs up for “eSports” on Friday (session ID 15) I want to update the user’s conflict to true ideally when they click the toggle for signing up, but it could be a separate button.

Screen Shot 2023-05-13 at 7.32.10 PM

Thank you so much for all of your time and help!