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"}
)
);
Solved! Go to Solution.
@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...
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...
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
49 |