cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KarlB
Level: Powered On

Leave Request connection to excel manually and auto accept certain types of absence

Dear all,

 

I'm trying to establish a connection between the app and a excel file on OneDrive in order for it to correctly save the data from the requests (as for now, everything dissapears after the app is closed and also for some future features.

Maybe it's has been removed but I do not get the option to "make your own version of this app".

So I guess my best option is to modify the template in order for this connection to work.
I have tried multiple ideas from similar issues but nothing seems to work, it only generates hundreds of errors. Maybe the posts are too old and some thing have changed.

I have made a table with all the fields (title, detail, startdate,etc) and connected to it. But that is as far as I have gotten.

I also would like some help with auto approving (but still send email) certain types of absence. Let's use Bereavement as a example.


If there is a kind soul out there, I would very much appreciate a guide on how to do this manually.

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: Leave Request connection to excel manually and auto accept certain types of absence

Hi @KarlB ,

 

Sorry for my ambiguity.

You should follow the upper the patch function (LeaveCollection), just modify the datasource from LeaveCollection to Table1.

And you need to add code when creating and editing request. 

So please refer to the following screenshots, add the code into the corresponding location:

1.  (Edit request)Snipaste_2019-11-20_18-02-20.png

2.  (Create request)

Snipaste_2019-11-20_18-03-38.png

Note: Make sure the column names of table is the same with the columns in codes.

Best regards,

Sik

View solution in original post

7 REPLIES 7
v-siky-msft
Level 10

Re: Leave Request connection to excel manually and auto accept certain types of absence

Hi @KarlB 

 

Do you want to save the Leave collection to Excel? 

you should first to create a table contains all columns you want.

Snipaste_2019-11-19_12-03-20.png

Then, modify codes in Onvisible of ConfirmationScreen, add the code of patching data to excel.  As below shown, the code in red line is what I add, you can refer to it.

Note: ff is the Excel table name, and i only test 5 columns.

Snipaste_2019-11-19_11-59-40.png

Snipaste_2019-11-19_12-02-33.png

Please have a try.

Best Regards,

Sik

KarlB
Level: Powered On

Re: Leave Request connection to excel manually and auto accept certain types of absence

Thank you for your reply!

A question. Do I edit the upper part as well?
My code looks like this (unedited):
code1.png

v-siky-msft
Level 10

Re: Leave Request connection to excel manually and auto accept certain types of absence

Hi @KarlB ,

 

Are codes you post from Onvisible property of ConfirmationScreen? It is weird to find different from our templates.

However, there is no need to modify your code to match what I post, you just need to Patch data to Excel when patching it to LeaveCollection. 

Snipaste_2019-11-20_10-23-45.png

Best regards,

Sik

KarlB
Level: Powered On

Re: Leave Request connection to excel manually and auto accept certain types of absence

Thanks for hanging around, Sik!
The reason the template is looking different is because I use the mobile template.

I have done the following:
powerapps.png

 

I receive four errors:

Error1 - Name isn't valid. The identifier isn't recognized
Error2 - Invalid argument type

Error3 - The function 'Patch' has some invalid arguments

Error4 - The specified column 'Approver' does not seem to exist

 

Best Regards,

Karl

 

v-siky-msft
Level 10

Re: Leave Request connection to excel manually and auto accept certain types of absence

Hi @KarlB ,

 

Sorry for my ambiguity.

You should follow the upper the patch function (LeaveCollection), just modify the datasource from LeaveCollection to Table1.

And you need to add code when creating and editing request. 

So please refer to the following screenshots, add the code into the corresponding location:

1.  (Edit request)Snipaste_2019-11-20_18-02-20.png

2.  (Create request)

Snipaste_2019-11-20_18-03-38.png

Note: Make sure the column names of table is the same with the columns in codes.

Best regards,

Sik

View solution in original post

KarlB
Level: Powered On

Re: Leave Request connection to excel manually and auto accept certain types of absence

Thank you so much Sik!
It's working perfectly now. I learned a lot from you!


Best regards,

Karl

KarlB
Level: Powered On

Re: Leave Request connection to excel manually and auto accept certain types of absence

One problem remain.
It saves to excel but does not retrieve from excel.
So basically when I close the app, the request is gone in the app but exists in the excel file.

The approver gets a mail but nothing is there to approve.

 

Best regards,

Karl

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (3,866)