How to trigger an action when a  database action was done.
Question

I am currently working on a form screen that requires user to sign their name in order to complete the form. I create a QR code so user could scan it with their phone and navigates to another screen to do the signing action. However, I am struggling on making the original form screen to detect if the user have finish their action. 

What I was thinking before is to have a screen action that queries the data from database once in a while and check if the sign in data is created. But I don't have any idea how to achieve this. Please give me some advice if you know how to deal with this problem.

Thank you,

David Lin

mvp_badge
MVP
Solution

Hi David,

If I am right what you want to do is 

Fill form in your desktop/laptop browser -> Generate its QR code -> Scan this QR Code in phone -> Open the link in QR code on mobile browser -> sign on phone and save -> once it is saved from phone the original screen on your desktop/ laptop should refresh.

If this is what you want then you have to use web sockets for sending events from your server to client/ browser. You can send this event to your browser when you save sign data in phone or you can also follow the approach shared by Jose using process event.

For web socket you can use services like pusher and firebase to push events from server to client. There are some forge components also which you can use.

Thanks for giving me these advice. I end up using a polling method to achieve this.

Hi David,

you can control that automatically only with Create action.

  • Set the entity to expose process events:


  • Create a process that is launched upon a Create on that entity and call your action from that process:


Regarding other actions over the database (update and delete), you need to control it manually calling your action after each Update and Delete.

Regards

Hi David,

Use a local variable of Boolean type set its value true in the flow at the end of your action, use that variable in your condition or pass it's value by the event  for making original screen.

Regards

Shradha

mvp_badge
MVP
Solution

Hi David,

If I am right what you want to do is 

Fill form in your desktop/laptop browser -> Generate its QR code -> Scan this QR Code in phone -> Open the link in QR code on mobile browser -> sign on phone and save -> once it is saved from phone the original screen on your desktop/ laptop should refresh.

If this is what you want then you have to use web sockets for sending events from your server to client/ browser. You can send this event to your browser when you save sign data in phone or you can also follow the approach shared by Jose using process event.

For web socket you can use services like pusher and firebase to push events from server to client. There are some forge components also which you can use.

Thanks for giving me these advice. I end up using a polling method to achieve this.

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