Hi all
I have created an IF statement inside a collect which posts to dataverse as you can see below:
Collect(
'Time',
{
'Code': TextInputCode.Text,
'Login Time': If(IsBlank(DefaultStartTime7am),Now();DateTimeValue("7:00 AM")),
}
);
So if the label is blank then it will create a now() time for certain users while if not blank, it will say that the user started at 7am.
I am trying to now figure out how I can add into this statement that if the user with a non blank label signs in past 7am, it will be recorded as now() instead of 7am. Im unsure how to add this into the syntax if someone could help me write this out. I have a feeling I would need to use greater or less than signs to accomplish this.
Thanks so much for the help. Kind regards.
Solved! Go to Solution.
Please try this
Collect(
'Time',
{
'Code': TextInputCode.Text,
'Login Time': If(IsBlank(DefaultStartTime7am) || (Now() > DateTimeValue("7:00 AM")),Now(),DateTimeValue("7:00 AM"))
}
);
Thanks,
Stalin - Learn To Illuminate
Please try this
Collect(
'Time',
{
'Code': TextInputCode.Text,
'Login Time': If(IsBlank(DefaultStartTime7am) || (Now() > DateTimeValue("7:00 AM")),Now(),DateTimeValue("7:00 AM"))
}
);
Thanks,
Stalin - Learn To Illuminate
Hi @StalinPonnusamy Thank you for your help.
It seems to be stuck on the now() time. So it wont recognize that the current time is less than the DateTimeValue and keeps recording as now() when its meant to round up to 7am.
'Login Time': If((DefaultStartTime7am.Text="Yes") || (Now() > DateTimeValue("7:00 AM")),Now(),DateTimeValue("7:00 AM"))
Thanks again for your help.
Hello,
you could use "Not" ex:
if(Not isBlank(), true, false)
Hope this help,
Regards.
Hi @AmeerJab Thanks for your suggestion.
'Login Time': If(IsBlank(DefaultStartTime7am.Text="Yes") || (Now() > DateTimeValue("7:00 AM")),Now(),DateTimeValue("7:00 AM"))
This works but I need to filter if the DefaultStartTime7am.Text="Yes" , so if it = "No" then the time should be now() instead of 7am
Looks like 7 AM should be
All other times should be the current time.
If(DefaultStartTime7am.Text="Yes" || Now() < DateTimeValue("7:00 AM"),DateTimeValue("7:00 AM"),Now())
DefaultStartTime7am is a boolean field or Text field?
Thanks,
Stalin - Learn To Illuminate
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
192 | |
67 | |
46 | |
41 | |
22 |
User | Count |
---|---|
246 | |
120 | |
83 | |
74 | |
69 |