cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rama96x
Resolver I
Resolver I

Patch OnTimerEnd

Hello,

 

I wannabe able to Patch some basic text into my Dataverse table, however, nothing really on the property OnTimerEnd

This is what I have done:

Set(
    varStartSampleNow,
    Patch(
        'Test Data',
        LookUp(
            'Test Data',
            varStartSampleNow.'Test Data' = 'Test Data'
        ),
        {Notification_2: "X"}
    )
);

 

1 ACCEPTED SOLUTION

Accepted Solutions

@WarrenBelz 
Yes it is unique! 🙂 
I managed to make it work.

The reason why it didn't work was because it didn't "understand" when the timer ends. The reason was that the 'main timer' acted as a stopper for the other timer, so it would only patch when the main timer actually ended... 

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @Rama96x ,

What are you trying to do here - your criteria is when the field equals a value in the variable that is not set yet (it is the end result of the code)

LookUp(
   'Test Data',
    varStartSampleNow.'Test Data' = 'Test Data'
),

 

@WarrenBelz sorry, I should have explained this part
I have a "Start timer" button, where I am basically patching start time, user email and setting the Timer as active.
This is stored in a global variable called varStartSampleNow

 

What I'm then trying to do now is having a second timer that counts down with -30 minutes in relation to the main timer. When this timer has then ended I want to patch to this specific record which I'm targeting through an ID (called 'Test Data'). 

Basically, LookUp an existing record and patch to column name 'Notification_2'

 

Hope it makes sense!

Set(
    varStartSampleNow,
    Patch(
        'Test Data',
        Defaults('Test Data'),
        {
            'Taken By': User().Email,
            'Timer Active': true,
            'Timer Start':Today() + Time(Value(txtDDHour.Text),Value(txtDDMinute.Text),0)
        }
    )
)

Hi @Rama96x ,

Still a bit lost - your initial post Lookup has it looking at itself, so all records will equal.

I tried to add this bit of code on a button on its OnSelect property, and this works as intended (it patches to a specific ID), so I don't agree that it equals all records

 

Patch(
    'Test Data',
    LookUp(
        'Test Datas',
        varStartSampleNow.'Test Data' = 'Test Data'
    ),
    {Notification_1: "TEST"}
);

 

 

I also tested this on a different timer where I'm basically just patching a new record (Defaults), and this works fine on the OnTimerEnd property on a timer. I think the issue is that the timer that is supposed to act as a notification is counting down and not up, so perhaps it doesn't understand when the timer actually ends?

@Rama96x ,

I do not use Table Variables (that is what collections are for), but I see it now if 'Test Data' is unique. So you are saying this does not change the required record ? 

@WarrenBelz 
Yes it is unique! 🙂 
I managed to make it work.

The reason why it didn't work was because it didn't "understand" when the timer ends. The reason was that the 'main timer' acted as a stopper for the other timer, so it would only patch when the main timer actually ended... 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,940)