How to create a microflow that keeps running?

0
Hi All, I doubt this is possible but I need to create promotions for my products in store. When a certain date and time strikes, the promotion will automatically update the price of my products, without the admin having to manually click a start  button on the promotion. This will happen for the end of the promotion as well.   Could anyone kindly guide me how I should approach this? Is it by creating a microflow that continues running and checking the time/date against the current date/time? Please offer any suggestion, your help would be appreciated! Thank you :)
asked
4 answers
3

Hi Phoebe,

 

Creation of scheduler events will help you to trigger microflow continuously on a daily/ weekly/yearly/monthly/second/minute/hour basis.

answered
0

hii Phoebe Tan

there is no need to continuously run the microflow 

just take a data grid with  data source is microflow so when you enter to the page microflow will be executed and inside data view  so your content 

and if you want to choose datagrid then it have property to refresh in seconds so microflow will be call every second

and for fetch data use OQL and use case or if else on price column to update price withing a certain time 

like in OQL :=   CASE  addDays(yourPromotionalEndTime, -5) < $currentTime THEN LowPrice Else CurrentPrice END

so here using add days the lowPriceWill be fetched before five days of  your end Of Promotional time  

else currentPrice will be fetched by OQL 

so when someone enter in your website OQL will be executed and then according to currenttime and your end  promotinal time updated data will be visible there on the page  

 

Microflow Timer | Mendix Documentation

answered
0

Hi,

Kindly check the ‘Count Down Timer with Action’ widget 

The widget will also fire an Action you can defined when the count down reaches 0

https://marketplace.mendix.com/link/component/117645

Also check the ‘Countdown Timer’ widget

https://marketplace.mendix.com/link/component/118631

Hope it helps!!!

 

answered
0

Hello Phoebe,

 

Use the task queue to achieve to update the records using queued jobs. It will not cause any performance issues. 

Below is the documentation of the task queue
https://docs.mendix.com/refguide/task-queue/

 

answered