0
votes

So the problem I am having is with Google App Maker. I have two SQL databases.. One with employee information and one with recruiters. Each recruiter has a name a percentage and each employee have a recruiter and percentage set to them. So when setting up a new employee I set a recruiter however I cannot automatically set the percentage of the employee based on the recruiter. So I have a form where I select the recruiter and I want to from this also automatically pick the percentage.

There isn't much "coding" to App Maker so I wasn't sure if Stackoverflow would be the best place to come but I thought I'd give it a try.

1

1 Answers

0
votes

Suggesting, that you actually have one database with two tables I will say that it would better to have relation between Employee and Recruiter tables. In that case you'll be able to access percentage through the relation and it will be always in sync if updated:

var percentage = employee.Recruiter.Percentage;

If you need to create kind of snapshot of recruiter's percentage in employee's record, then you can go with onBeforeCreate event of the Employee model:

record.Percentage = record.Recruiter.Percentage;