Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Make one field auto enter when I select a name in another field

Featured Replies

I am trying to simplify by automating this task.

I have a field that says "staff name". I also have a field that says "staff email".

I did a script that will insert a email if "staff name" is selected, but I have to somehow make the script execute.

Can someone tell me how to make it auto execute the script when I select "staff name"?

-OR-

Give me a better solution to make this happen?

Thanks everyone! Love this forum!

Make your StaffEmail an autoenter calc with replace existing value turned ON.






Evaluate(Quote(

Let([

a = StaffName];

Case(

a = "john doe"; "[email protected]";

a = "Jane Doe"; "[email protected]";

ect...))); StaffName)



What this will do is evalueate the auto enter calc every time Staff Name changes.

  • Author

WOW! Very nice! You just made the first 6 months of this year!!! THANK YOU SIR!

Hey Zero, I'm curious why you wouldn't simply use the Let() statement without the Evaluate(Quote(...)) and have it replace the contents, like this:

Let(

a = StaffName;

Case(

a = "john doe"; "[email protected]";

a = "Jane Doe"; "[email protected]")

)

They do evaluate a little differently, where using the Evaluate(Quote(...)) does not replace the existing Email if there's no match in the Let(), but is this desired behavior? See the sample.

I don't want to rain on Cal's parade, but it seems like Email would be an attribute (field) in a Staff table. It would be structurally better then, to simply reference the related Email field whenever you need to see the email address for a selected staff name. It's not a good practice to hard-code all the staff email addresses in a case statement as suggested.

EvaluateTest.fp7.zip

Sorry for taking so long to reply here.

Yes, Idealy email would be a related field and would auto lookup in the first place. By now ( a few days later) I have no idea why I didn't just tell them that, as I dislike to hardcode anything that might ever change.

I've had funny results just using Calc fields before for things like this ender, although they were probably due to faulty programming on my part, I've grown fond of the evaluate function and often use it where it isn't nessecarily needed.

Anywho, Cal, ender is right, doing it the way I originaly showed you is a bad idea. Create another field in your staff table that contains thier email, that way you don't have to update your code everytime a new staff person is added to the database.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.