Hi, we are developing a free system that allows to coordinate the efforts of volunteer rescue and emergency groups working in a disaster or conflict zone. For us it's extremely important to be able to know where our medics and support teams are located. Since they use a PowerApps to create a report for every patient they attend, we incorporated into this same app a formula that is triggered with the OnVisible event and that sends us their location so it can be stored in a SharePoint list and then shown in a Power BI map. This is the formula to report their location
Patch('SharepointList',Defaults('SharepointList'), {Title:"Title", Latitud:Location.Latitude,Longitud:Location.Longitude})
This formula is working great, however it creates a separate record every time. We would like to alter this formula to evaluate if the current user already has a location record in the list or not, and to create a record if it doesn't already have one or modify it if a record for this user already exists. This way we would only have the most update location for the user.
Any help with this would be greatly appreciated.
Best regards.
Hi All,
@gcanelon @Meneghino
I have a Leave Application, in which I am using two lists.
List 1) LeaveRequests
List 2) EmployeeLeaveBalance.
When the user comes in my app, it requests for Leave, Let's say Annual Leave and fill out the information in the form and press on the submit button,
the Submit button The First Patch Command first patches in the LeaveRequests List of that User, which stores (User Email, LeaveType, Description, Manager Email, Start Date and End Date). and after that another Patch Command runs which, patches that user's Leave Balance in the EmployeeLeaveBalance List which Stores (User Email, Total Leaves, Annual Leave balance and Days Requested).
Now, I want to save only 1 record for each employee and then if he/she requests again. So, I want to update the EmployeeLeaveBalance List and update their LeaveBalance Column Everytime which is Subtracted from their Days Requested.
how to do this, Any help in this Regard.
Thanks!!!
@Meneghino Awesome code! Simple and worked like a charm !
How I could not figure this out earlier ...
Anyway, all credits to your solution, added to dev. pattern inside company over here.
Cheers and thanks a lot!
Hi @Meneghino
I have a problem when pressing the Send button, the form should be reset. When you add a new item, it is added to the list as a new item and not merged with the last item saved in the list.
How can I press the Send button? The form is reset as if I opened the application again.
Note that I used ResetForm but unfortunately did not work.
Thank you.
Hi
I am a newbie in Power Apps. I only wanted to save records into an Excel file when I press a button.
I am quite confused of how to do it.
What code should I use? and how the syntax arrangements will be?
I created my own form to begin with. I wanted to save the input data from that form to a local EXCEL file that I have
Thanks,
Hello J. Yes, it's the post marked as a solution here. That worked for me. I hope it does for you.
Regards.
hi there, did you ever find a solution to this? I'm having the same issue...
Hi I have faced something similar and need some help !
I have the submit button with the OnSelect function "Patch(Table1,Defaults(Table1),Form9.Updates,Form10.Updates)"
However, when I wanted to edit and update the records, it will create a new row of record instead of updating the selected record. How could I work around with this ?
Awesome Meneghino, it works flawlessly. I tried it with several users and its smooth and does what it's intended to do. Thanks for your help. Its greatly appreciated.
Regards.
Hi @gcanelon
Yes, I think the issue is that MyPatchedRecord is a table and not a record. Try this instead:
ClearCollect(MyPatchedRecord, Patch('Ubicacion de personal de recate',{ID:CurrentUserID}, {Title: CurrentUser.FullName, Latitud:Location.Latitude,Longitud:Location.Longitude})); If(IsBlank(CurrentUserID), Set(CurrentUserID, Last(MyPatchedRecord).ID))
Please let me know
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48