Group Actions - Not Running

Thought this would be an easy thing to accomplish. It works in other Apps but not in this one.

1 action calling 2 further actions.

1st Action:

Domearian_0-1712929677478.png

2nd:

Domearian_1-1712929768340.png

Target (which works fine): IF(LOOKUP(USEREMAIL(), User Administration, Email, Daily ReSync)<Today(),LINKTOVIEW([Menu Item])&"&at="&(NOW()+1),LINKTOVIEW([Menu Item]))

3rd:

Domearian_2-1712929905215.png

This has the condition set in the Bahaviour: LOOKUP(USEREMAIL(), User Administration, Email, Daily ReSync)<Today()

Subaction (New Login DateTime):

Domearian_3-1712930005310.png

The initial action is initiated when clicking on the menu item:

Domearian_4-1712930063659.png

It simply will not run both actions together. If I put the "record Datetime" action 1st in the queue it runs just that. If I put it second it only run the other. What have I misses?

What I want is if the users daily resync date is not today is for it to do a re-sync and then record todays date. Then later if it notices that it is todays date, it simply LINKTOVIEW([Menu Item]). Simplzz, or so I thought!

0 4 65
4 REPLIES 4

Hello there,

First of all I suggest you look into implementing a Current User System

It will make your life so much easier when you have to work with actions such as these that read your users table, and it makes your expressions more readable as well.

Second, I've built an "Auto Sync" function as well on one of my apps, and in my experience, you run the update first on the group action, but there's a caveat, I made 2 columns for this function in the users table, not just 1:

"last_forced_sync_date" works the same as your "Daily ReSync" basically

"forced_sync_counter" is a counter that resets everytime a new date is created in the "last_forced_sync_date", because since the data change on the users table HAS to run before the navigation action, that means tracking the date alone won't be enough to make this work because by the time the navigation action has his turn the date of the user's last sync would be set to TODAY() already, so it won't ever run.

My solution is not only to save the date, but also the sync counter for that day, so that my navigation action will ONLY run if the sync date is equal to today and the forced sync counter is equal to 1.

Here's a few screenshot of my actions to help guide you:

The grouped action

Rafael_ANEICPY_0-1712936921694.png

The Ref Set forced sync date

Rafael_ANEICPY_3-1712937174450.png

It's condition to run:

 

 

OR(
 INDEX(currentUser[forced_sync_counter],1)=1,
 INDEX(currentUser[last_forced_sync_date],1)<>TODAY()
)

 

 

The navigation action

Rafael_ANEICPY_1-1712936951231.png

The target of this action

 

 

IF(
 INDEX(currentUser[forced_sync_counter],1)=1,
 LINKTOVIEW([viewDeepLink])&"&at="&(NOW()+1),
 LINKTOVIEW([viewDeepLink])
)

 

 

(do you see how easy having a current user system makes it look? go build one NOW)

The action that changes the data on the users table:

Rafael_ANEICPY_2-1712937070610.png

the "forced_sync_counter" expression:

 

 

IF(
 [last_forced_sync_date]<>TODAY(),
 1,
 [forced_sync_counter]+1
)

 

 

Let me know if you have any further questions

Thank you for your reply,  Adding a counter isn't what I am wanting to do. I simply want to know if a person has re-syncrhonised today. If not, re-synchronise and add todays date. If they have, don't add todays date and give them the view they have asked for. Incidentally, I already operate a user table which is called user administration.

So to ask the question, why will it only run which ever action is first. It doesn't run the second.

The answer I tried to give was that you won't be able to do this:


@Domearian wrote:

I simply want to know if a person has re-syncrhonised today. If not, re-synchronise and add todays date. If they have, don't add todays date and give them the view they have asked for.


With only 1 date column, that's why I added the counter.


@Domearian wrote:

So to ask the question, why will it only run which ever action is first. It doesn't run the second.


When doing grouped actions, navigation actions should always be last because once the app starts the navigation action it will finish the action at that point, even if there are other actions under the navigation action.

And since your navigation has to be last, that means you will update the users last sync date to TODAY() first, and since the condition of your navigation action is that the date is not today, that means that without using a sync counter you will NEVER be able to force them to resync in these conditions.

 

 

ok, got it. So what I have done is to utilise time and allow a 8 hour window. Time recording is first. second is an action that re-synchronises and selects the view if NOW() > that recorded datetime + 8 hours. A third action to simple run the View. It will run the second action if within 10 seconds of the first action or run the 3rd if the 10 secs is exceeded. Initial testing for 1 minute instead of 8 hours seems to do the trick but want to view it over real time.

If it fails then I will look at your counter option. Thanks again for your tip. I didn't realise about the view actions cancelling other actions.

Top Labels in this Space