cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Smudgers9
Helper III
Helper III

Loan Equipment App

Hi, I'm hoping someone will be able to assist with an App I'm developing.  Feel I've bitten off more than I can chew  🙂

 

Consept

Loan Equipment to be checked in and out using a PowerApp

 

DataSource

SharePoint List (see attached screen shot)

 

App

Several screens listed below with descriptions

Home - Select Check Out or Check In

CheckOut - Select which equipment type (laptop or projector), select date required for then select the item

Loanee Details - Info from previous screen is pulled through.  Free text field to enter loanee name is included

Check details - All details pulled through to final screen to check everything is correct

Confirmation - Page to confirm booking has been successful

 

Process

On Home screen click Check out - Takes you to CheckOut page.  Select which type of hardware to loan (for this example a Laptop).  Select date range for the loan.  This should then filter the gallery to the right to only show laptops that are available during the date range selected.  The loanee can then select the laptop they require and press Continue

Takes you to the Loanee Details page which auto populates the date boxes and requested item.  There is a free text box for the loanee name to be entered.  Press Confirm Loan.

Takes you to Check Details page to double check all the details are accurate.  Press Check Out

Takes you to a loan confirmed screen.  Press Home

 

Assistance required

I'm looking for assistance on how to link all of these together. 

I need the search boxes to filter the gallery which is presented from the DataSource to only show laptops available during the time period selected.  On the gallery I need to be able to select an item so when Continue is pressed it pulls those details through to the next page where you simply have to enter the loanee name and press Check Out.  Once the item is checked out on screen it needs to write back to my datasource and update the Loaned to, Date loaned, Return due date, Checked out and change status to unavailable.

 

See the attachments including a demo video.  If you require further information please ask.

 

 

12 REPLIES 12

Quick questions: Is there a reason you have 2 separate data sources for the equipment? Based on the 2 screen shots provided, it looks like you have a data source for Laptops and another for Projectors. Why not have just 1 data source with a column indicating the equipment type (i.e. laptop, projector, power cord, HDMI cable, etc.)?

 

Also, I would suggest using Power Automate to update the data sources based on the input from the users. Have you looked into using this?

v-xida-msft
Community Support
Community Support

Hi @Smudgers9 ,

Could you please share a bit more about your scenario?

Do you want to link the several screens together? Could you please share a bit more about the "Loaned to" field, "Checked in" field, "Checked out" field, and Status field in your SP Lists?

 

I have made a test on my side, please consider take a try with the following workaround:

Within the Home screen, set the OnSelect property of "CheckOut" button to following:

Navigate(CheckOutScreen)

 

Within the CheckOut screen, set the OnVisible property to following:

Set(HardwareType, Blank())

set the OnSelect property of the Laptop Icon to following:

Set(HardwareType, "Laptop")

set the OnSelect property of the Projector Icon to following:

Set(HardwareType, "Projector")

Set the Items property of the Gallery to following:

If(
   HardwareType = "Laptop",
   Filter('Loan Equipment - Laptops', Status.Value = "Available"),
   HardwareType = "Projector",
   Filter('Loan Equipment - Projector', Status.Value = "Available"),
   Filter('Loan Equipment - Laptops', ID = -1)   // return a empty table when there is no hardware type is selected
)

Note: It is not necessary to filter the available loan equipments based on the selected date range, you could filter your Gallery Items based on the Status column value directly. I assume that the Status column is a Choice type column in your two SP Lists.

Set the OnSelect property of the Gallery to following:

Navigate(LoaneeDetailsScreen)

 

Within the LoaneeDetailsScreen, set the DefautlDate property of the DateFrom DatePicker to following:

LoanStartDatePicker.SelectedDate

set the DefaultDate property of the DateTo DatePicker to following:

LoadEndDatePicker.SelectedDate

Note: LoadStartDatePicker and LoadEndDatePicker are both from your CheckOut screen.

Set the OnSelect property of the "Confirmed Loan" button to following:

Navigate(CheckDetailsScreen)

 

Within the Check details screen, set the OnSelect property of the "Check Out" button to following:

If(
   HardwareType = "Laptop",
   Patch(
         'Loan Equipment - Laptops',
         Defaults('Loan Equipment - Laptops'),
         {
            LoanedTo: LoanNameTextBox.Text,  // LoanNameTextBox is from your "Loanee Details" screen
            'Date Loaned': LoanStartDatePicker.SelectedDate,
            'Return due date': LoanEndDatePicker.SelectedDate,
            'Checked Out': true,
             Status: {
                        Value: "Unavailable"
                     }
         }
   ),
   HardwareType = "Projector",
   Patch(
         'Loan Equipment - Projector',
          Defaults('Loan Equipment - Projector'),
          {
            LoanedTo: LoanNameTextBox.Text,  // LoanNameTextBox is from your "Loanee Details" screen
            'Date Loaned': LoanStartDatePicker.SelectedDate,
            'Return due date': LoanEndDatePicker.SelectedDate,
            'Checked Out': true,
             Status: {
                       Value: "Unavailable"
                     }
          }
   )
);
If(
   !IsEmpty(Errors('Loan Equipment - Laptops')) && !IsEmpty(Errors('Loan Equipment - Projector')),
   Navigate(CnfirmationScreen)
);
Reset(LoadStartDatePicker);Reset(LoadEndDatePicker);Reset(LoaneeTextBox)

Note: The 'Checked Out' is a Yes/No type column in your Both SP Lists, and the LoanedTo column is a Text type column in your both SP Lists.

 

Please consider take a try with above solution, then check if it could help in your scenario.

 

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

You're right it would make sense to have 1 data source, I just did it this way because its was a retrospective decision to include projectors.

I have never looked into Power Automate so will have to look into it.

This looks good, I will give it a test today and see how it works.  In response to your question about filtering on date, I do need it to filter on date because the equipment might be booked out for a future date so will still be set as available in the list on the date the person creates the booking but not available for the dates they require.  If that makes sense.

Also the Loaned to field is the Loanee name, The checked In and Checked Out fields are to indicate if the item has been checked in or out in order to audit if the item has been returned correctly.

Hi @Smudgers9 ,

Have you taken a try with the solution I provided above? Is it helpful in your scenario?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

I have managed to use some of your suggestions to improve my App but not everything was applicable so I am still working on the solution.  But thank you for your suggestions.

chrisog
Responsive Resident
Responsive Resident

Hi @Smudgers9,

 

Find attached a video demo of my mock-up

@chrisog Attached Demo

@chrisog 

 

Demo of app

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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