cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Leave Request and Excel

Good day,

 

I am very new to PowerApps like most people that post here. I foudn the LeaveRequest app it is perfect for our small company. I have spent some time now working out all the kinks and changed it to suit out needs and our holidays. (South Africa) .

 

The only issue I have is the info not saving to the provided Excel sheet and or Sharepoint List that I created. 

 

There are a couple of posts on here already with people having the same problem but I just cant get it working. 

 

According to the posts, I need to change the Confirmation Screen - Patch line. THis is the one I currently have after changing: 

(Leave being the name of my sharepoint list and yes, it is linked as a data source)

 

Patch(Leave, If(_editingRequest, LookUp(Leave, LeaveID = GalleryRequests.Selected.LeaveID), Defaults(Leave)),
{
Title: First(RequestEdit).Title,
Detail: First(RequestEdit).Detail,
StartDate: First(RequestEdit).StartDate,
EndDate: First(RequestEdit).EndDate,
LeaveType: First(RequestEdit).LeaveType,
Approver: First(RequestEdit).Approver,
Status: First(RequestEdit).Status,
Requester: First(RequestEdit).Requester,
LeaveID: GalleryRequests.Selected.LeaveID

}
),

 

 

The above changes dont seem to work. I get the follow error (see attachment)

 

Please can some show me exactly how my code should look to use the EXCEL sheet provider or alternatively to use the SP list. 

 

THanks

 

4 REPLIES 4
RandyHayes
Super User
Super User

@Anonymous 

So, the very first obvious thing that I see is that you end your Patch with a comma.  That should be removed.  But, I believe that perhaps was just a typo?

Next question (if that's not the problem), are you using Excel or SharePoint?  If you've converted over to SharePoint, then what are the definitions of the Columns in your list?  You need to make sure that you are putting the proper data types into the corresponding columns in your patch.  And, if you've created some of those columns as complex types (person column, lookup column, choice column, etc.) then there are other provisions that need to be made in your Patch statement.

 

Take a look over that and see if that leads to any revelations. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

Hi Randy, 

 

thanks so much for the response. 

 

Ok, after I posted, I decided to start fresh again. I deleted the app and data and started from the top. 

 

Currently, I am using the default Excel sheet that the app provides. I then figured out how to link the App to the excel sheet instead of using the built in Collection. 

 

THe problem I am currently struggling with is sometimes it works (saving into the excel file) and other times - Like now, it doesnt want to. The App funtions with out any errors.

 

So on the ConfirmationScreen - OnVisible, I have this:

 

If(_editingRequest,
//if editing a request, revise the record that is being edited
Concurrent(
Patch(Leave, GalleryRequests.Selected,
{

 

Leave being the Tab inside the sheet. 

 

earlier, I went alll in and found all LeaveCollections and replaced them with the Leave, now I cant remeber where they all are so its difficult. Is there a "replace" funtion that I dont know of maybe lol? 

 

You can see in the attachments that there are no known errors in the code anymore. 

 

Thanks again

 

Anonymous
Not applicable

Hi, ok I fixed the Excel link and it is saving the data. 

 

Now i need to get the balance sheet to work 😞

@Anonymous 

So it sounds like you are making progress.  Just post back if you get stuck again.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,133)