Hey guys,
I am creating a check-in / check-out app on PowerApps that only allow users to check-in or check-out based on geolocation. I thought the easiest way would be creating a label, then creating a global variable "On Select" which would include the coordinates from a location. I would the same thing for the device's location which would include the location.latitude while creating the global variable for the device.
In the end, I thought I could check if the label.text result would contain any results from the other label.text before inserting. Just to make sure the user is at the location.
I already created both label texts which include the global variables. Does anyone know how I could check or compare if a label would contain strings from another label before checking in? I've done everything I could but with no success. I would appreciate it if someone could help me with this!
Thank you,
Hello Everyone
I want to create a flow to send a response for all received inquiries that match the inquiry in an excel sheet ex.
check the flow for more details
Thank you in advance
Hi guys
I hope you can help me too ,power automate I need an expression to help me compare a text in an email and a text in an excel sheet I used (Contains ) for the action( list a row in a table )in the( filter query part) yet it doesn't compare if the sentence is more than the one in the excel
for example, check this email below
Hi
what is your working time?
Regards
so the flow is to reply to this email after comparing and filtring the excel and then get the column next to it, so I need to answer any email containing working time
Hi @v-xida-msft ,
Sorry, It took me a while to answer because I've been testing with some users. I am happy to say your expression worked well. The only thing is I am having issues right now is my check-out button. Why does my check-out button is creating a new line for some users when they check out? Side note: That doesn't happen to me. Here is a screenshot of that:
Here is my check out button expression 'On Select'. Is there anything wrong with it?
Refresh(CheckInCheckOut);
If(
!IsBlank(LookUp(CheckInCheckOut,PersonalEmail=Office365Users.MyProfile().Mail && Text(Created,"[$-en-US]mm/dd/yyyy")=Text(Now(),"[$-en-US]mm/dd/yyyy")))
&&
Abs(Value(FALatLabel.Text)- Value(DeviceLatLabel.Text)) <= 0.0005000
&&
Abs(Value(FALongLabel.Text) - Value(DeviceLogLabel.Text)) <= 0.0005000,
Patch(
CheckInCheckOut,
LookUp(CheckInCheckOut,PersonalEmail=Office365Users.MyProfile().Mail && Text(Created,"[$-en-US]mm/dd/yyyy")=Text(Now(),"[$-en-US]mm/dd/yyyy")),
{
Check_x0020_Out: Now()
}
);Navigate(Screen3,ScreenTransition.Fade)
,Notify("You are not at the destination location, please go the destination location and check out", NotificationType.Error)
)
Thank you so much!
Rafael Benicio
Here is an example that clearly shows that the comparison is done for the first 6 digits.
Here is the expression I used to check if Device 1 is onsite or not:
If(
Left(
Label_LocationLatitude.Text,
Find(
".",
Label_LocationLatitude.Text
) + 3
) = Left(
Label_Device1Latitude.Text,
Find(
".",
Label_Device1Latitude.Text
) + 3
) && Left(
Label_LocationLongitude.Text,
Find(
".",
Label_LocationLongitude.Text
) - 1
) = Left(
Label_Device1Longitude.Text,
Find(
".",
Label_Device1Longitude.Text
) - 1
),
"Onsite",
"Not onsite yet"
)
Here is the expression I used to check if Device 2 is onsite or not:
If(
Left(
Label_LocationLatitude.Text,
Find(
".",
Label_LocationLatitude.Text
) + 3
) = Left(
Label_Device2Latitude.Text,
Find(
".",
Label_Device2Latitude.Text
) + 3
) && Left(
Label_LocationLongitude.Text,
Find(
".",
Label_LocationLongitude.Text
) + 3
) = Left(
Label_Device2Longitude.Text,
Find(
".",
Label_Device2Longitude.Text
) + 3
),
"Onsite",
"Not onsite yet"
)
Hope this helps.
---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.
Thanks!
Hardit Bhatia
https://thepoweraddict.com
Hi @rafaelbenicio ,
Do you want to compare your device Latitude value and Longitude value with a range of your destination Latitude value and Longitude value?
Currently, within PowerApps, there is no way or function supported to check if a device's Latitude value and Longitude value is within a range of your destination Latitude value and Longitude value.
As an alternative solution, you could assume that if the value difference between the destination Log/Lat value and the device log/Lat value is not more than 0.2, they represents same location, so you could modify your formula as below:
If(
Abs(Value(DestinationLatLabel.Text)- Value(DeviceLat.Text)) <= 0.2
&&
Abs(Value(DestinationLongLabel.Text) - Value(DeviceLong.Text)) <= 0.2,
Patch(
CheckInCheckOut,
Defaults(CheckInCheckOut),
{
Title: "Check In&Out",
PersonalName: User().FullName,
PersonalEmail: User().Email,
Check_x0020_In: Now()
}
),
Notify("You are not at the destination location, please go the destination location and check in", NotificationType.Error)
)
Please note that the 0.2 gap point is based on your scenario, you could change the allowed difference value range to other values, e.g. 0.3 or 0.5 or 0.6, ....
Please take a try with above solution, check if the issue is solved.
Best regards,
I have but I don't want to compare things before the "." decimal place. I want to compare the first 6 digits. 😉
Thanks
Honestly,
It just looks like the StartWith expression is not working. My iPhone is getting the proper location, but it looks like the logic is wrong.
Do we have a better way of doing that through another expression? Thank you!
MS.Ragavendar
10
LC-26081402-0
6
EE-04041031-0
4