26
Views
6
Comments
Get notified when entity boolean attribute changes to true
Application Type
Reactive

Is it possible in OutSystems to have the changing of an entity attribute trigger an email outside of the actions where the create/update entity actions run? 

The scenario is that we want an account manager to get notified when a user from one of their clients successfully completes onboarding. There's an entity attribute called IsOnboardingComplete that gets changed to true at the end of the process. I'd like that to trigger an email to the account manager.

I have the email process setup now to run at the end of the onboarding process, but the issue is it has slowed down the time between when the user presses the Submit button and when they're taken to the next page because the action is waiting for the response from the email process that it was successful. It's fairly quick without the added email notification step, and now the added email step creates enough of a delay for me to want to know if it's possible to move the notification action somewhere else.

For reference, our company is in the process of moving from Quickbase to OutSystems for our core business functions, and Quickbase allows the simple changing of a record to be used as a triggering event for an automation. We use this type of record update event to trigger probably a couple hundred automation events. So, that's where our thinking is coming from.

Hi Daniel,

Yes, you can implement this as a process. Set the Expose Process Entity property for your entity to Yes, and then you can use its events as a trigger to start an asynchronous process.

You can read more about processes here.


Hi Daniel, as we only want this process to occur when onboarding is complete, you can always create a timer to send emails and validate whenever you update the entity the field returns to true and sends the email asynchronously. 

Is this a normal/best practice in OutSystems? I ask because for now we aren't going to be onboarding that many new users, so would it make sense to have this timer run however often it does? I also ask because, as I noted in my original question, we're coming from another system that allows for entity updates to trigger actions, and we use that a lot. So, would our OutSystems build just be full of processes running all the time looking for certain criteria? Wouldn't it be more performative to have the entity update event trigger the process?

The timer only runs when it wakes up (when the condition returns true), and it's better to use the timer than a process because the process would run every time there are updates in that entity. From what I understand, he only wants the email sending to occur when the onboarding is completed. So, for me, the timer is the better option. 

You can read more here: 

https://success.outsystems.com/documentation/11/reference/outsystems_language/processes/timer/?_gl=1*1nn40s7*_ga*MTEwOTE3MDM1MC4xNjk2ODYyMzA3*_ga_ZD4DTMHWR2*MTY5Njg2MjMwNi4xLjEuMTY5Njg2NTkxNC42MC4wLjA.

https://success.outsystems.com/documentation/11/developing_an_application/use_timers/create_and_run_timers/?_gl=1*1dm1r1p*_ga*MTEwOTE3MDM1MC4xNjk2ODYyMzA3*_ga_ZD4DTMHWR2*MTY5Njg2MjMwNi4xLjEuMTY5Njg2NTkxNC42MC4wLjA.

Hi Daniel,

OutSystems has someting called BPT. It allows you to automatically trigger a process when a value in an Entity record changes, but it has some drawbacks (e.g. it needs to start with the creation of a record). You can also start a process explicitly in code, instead of via a create of a record. In general it's considered an "advanced" topic, but once you get the idea it's not that difficult, especially for simple cases.

In your case, you could trigger, in the code, the start of a simple BPT process, maybe even a Light BPT process, that sends the e-mail in the background, while the user continues to the next page. To do so you need to set-up the BPT process, give it an Input parameter that identifies the content for the e-mail (typically some Id or GUID), add an Automatic Activity, and call, from that Activity, the Action that sends the e-mail (passing the Id or GUID).

In your code that also sets the Boolean IsOnboardingComplete, you trigger the BPT process by calling its Launch Action, passing the Id/GUID. The e-mail will then be send asynchronously, without delaying your screen.


Hello Daniel,

The kind of triggers you are looking for are not supported out of the box. I would not suggest you to use timer for such a simple requirement.

Keeping the notification logic in you CRUD action is the way to go. However, you mentioned that the logic waits for email process to complete. Seems you have a separate process to send emails and check their delivery status, don't you think that slowness is in the email process itself as you also stated the same? Were you using the same process with Quickbase too and was it faster there?  

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.