Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Script Block - link records based on conditions

Topic Labels: Scripting extentions
984 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrew_Miller2
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi everyone!

I have a particular situation where I’m trying to link several records from a view in one table to a specific view in another. I did some research from pre-existing articles–mainly this one–but I have a couple wrinkles for my script and don’t have the knowledge to make it happen:

I work for a non-profit where volunteers go online to write encouraging notes to authors who have sent digital stories to us. In this example base, you’ll see that I have one table for the digital stories, one table for the volunteer events, and one for the companies we work with.

Here are the complications: 1) I don’t want to “pack” any stories that were assigned to the same company from a previous event. 2) I want to assign a certain # of stories to the event based on number of attendees. So the script would count the number of attendees, multiply that by, say, 5, and assign that number of stories to the “assigned” field.

So in the “Volunteer events” tab, in the “Upcoming Events” view, I have an upcoming event with Company A:
Screen Shot 2020-10-09 at 5.22.21 PM

The script would search for 5*{Expected Volunteers} stories from the stories tab, but would only link records that haven’t yet been assigned to a Company A event (without overwriting the linked record info that’s already there!)
Screen Shot 2020-10-09 at 5.20.20 PM

Let me know what other info I can give, and thanks for the help! JavaScript is not my thing.

0 Replies 0