Automatic change value of enum based on date + 10 days

Hi all,

i have a form were i fill in datum and via a enumaration i can select "Ja", "Nee" and "On hold".

Form.PNG 

The input is shown in this view 

View.PNG

So i want the app automatic change from "On hold" to "Nee", based on the filled in Datum + 10 days. 

How can i do this? ps:  the field "In voorraad kast" is not a virtual column.  

Solved Solved
0 10 289
1 ACCEPTED SOLUTION


@Zuha wrote:

 

 
In stead of type Schedule.. can i use Data Change?

No.  Data Change bots only work based on some kind of trigger event by the user that causes an Add row, Edit row or Delete row activity.  It may be that these events happen based on some action firing but ultimately some action was taken by the user e.g. user tapping a button.

For your purpose, the rows are just sitting there with no guarantee of any kind of data change event happening by the user.   You still want the rows to change from "On Hold" to "Nee" regardless if a user touches the row or not.  This is where Scheduled Automation is used.


@Zuha wrote:

I'll add today a entry with on Hold and i will check tommorow if it automatic goes to Nee.


In an un-deployed app, Scheduled Bots are not run automatically.  You can still test it by tapping the "Run" button at the top of the Bot definition. 

But do please note...that based on the criteria of "[Datum] + 1 > TODAY()", it will be TWO days before the row is processed by the bot.  If you want to test it tomorrow, use either

[Datum] > TODAY()

or 

[Datum] + 1 >= TODAY()

 

View solution in original post

10 REPLIES 10


@Zuha wrote:

So i want the app automatic change from "On hold" to "Nee", based on the filled in Datum + 10 days. 


Do you mean that if a user selects a Date 10 days into the future that the "In vooraad kast?"  should be automatically set to "Nee"?

If so, do you really mean a Date >= 10 days into the future?

If this is not what you mean at all, please explain in more detail.

 

Hi,

yes this is what I mean: that if a user selects a Date… after 10 days into the future that the "In vooraad kast?"  should be automatically set to "Nee".

 

Ok, then in the "In vooraad kast?" column definition, set the Initial Value expression to something like:

IF([Datum] > TODAY() + 10, "Nee", "On Hold")

If you ALSO wish to prevent the user from changing this default value then set the Editable property of the column to:

[Datum] <= TODAY() + 10

This will default the to "Nee" when date is > 1o in the future AND only allow editing of that value once the row is within 10 from now. 

The code works.! But the user has to change manually from "On Hold" to "Nee" after 10 days? Is it possible to change it automatically when you sync the app. after 10 days?

So basiccaly it should work like this:
1. User fills in form and select date of example today (28-10-2022)
2. User saves the form
3. After 10 days.. the app will automatic changes every entry, based on the check of 10 days, from "On Hold" to "Nee". 

Oh ok, this contradicts what you confirmed in the previous post.  It's NOT when the user has set a Date/Datum 10 days into the future.  You want the "In vooraad kast?"  value to automatically change after 10 days have elapsed after the row was entered. 

As you said, initially.  The "In vooraad kast?" column is NOT a virtual column so I assume you need the ability for users to change it.

I would then suggest you create an automation/Bot with a scheduled event that searches for any rows more than 10 days old and then uses an action to set the "In vooraad kast?" value to "Nee".

I would start with these articles:

Bots: The Essentials 

Events: The Essentials

 

 

 

 

Hi,

Ive tried the following.. Ive added a vc colum that calculated the date after 10 days:

3.PNG

Than i know what the date is when it should go from "On Hold" to "Nee" . 

Ive created the following bot. It kinda of works... it works only when a certain row is updated. So i have to select a row open the form and edit it... than it works. But i want this to be triggered automatic without opening the entry.

1.PNG

2.PNG

Could you please guide me step by step... how i can work this. Im kinda new to bots.  the "In vooraad kast?"  value to automatically change after 10 days have elapsed after the row was entered. 

The bot is much simpler than you have created.

First, remove the virtual column computing the date.  You don't need that.  It will be checked on each run of the bot.

Please refer top the images below for what your full scheduled bot should look like.  Very simple.

Full Bot Outline - Just an Event and a single step Process

Screen Shot 2022-10-31 at 9.19.30 AM.png

 

Zoom in on Creation of the Event - update each of the circled areas

Screen Shot 2022-10-31 at 9.21.53 AM.png

Full Expression for Filter Condition  - by [Datum] date and if "On Hold"

this expression limits the number of rows to be updated for faster process.

Screen Shot 2022-10-31 at 9.25.41 AM.png

 

Zoom in on the Data Change step

Screen Shot 2022-10-31 at 9.26.04 AM.png

Thanks for the update. I will test by putting the 10 days in to 1. I'll add today a entry with on Hold and i will check tommorow if it automatic goes to Nee.

One more question...im using this app for personal use and its not been deployed.  In stead of type Schedule.. can i use Data Change? And if so... i dont see the option in Data change of ForEachRowInTable.

At the moment i have it like this and will this work?1.PNG2.PNG


@Zuha wrote:

 

 
In stead of type Schedule.. can i use Data Change?

No.  Data Change bots only work based on some kind of trigger event by the user that causes an Add row, Edit row or Delete row activity.  It may be that these events happen based on some action firing but ultimately some action was taken by the user e.g. user tapping a button.

For your purpose, the rows are just sitting there with no guarantee of any kind of data change event happening by the user.   You still want the rows to change from "On Hold" to "Nee" regardless if a user touches the row or not.  This is where Scheduled Automation is used.


@Zuha wrote:

I'll add today a entry with on Hold and i will check tommorow if it automatic goes to Nee.


In an un-deployed app, Scheduled Bots are not run automatically.  You can still test it by tapping the "Run" button at the top of the Bot definition. 

But do please note...that based on the criteria of "[Datum] + 1 > TODAY()", it will be TWO days before the row is processed by the bot.  If you want to test it tomorrow, use either

[Datum] > TODAY()

or 

[Datum] + 1 >= TODAY()

 

Thanks it worked 🙂

Top Labels in this Space