cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LIT01
Helper I
Helper I

Loan of office card

I have an office item that can be loaned out by staff via a Microsoft form. I would like to build a flow that sends an email to the staff applying for the loan of the item if the item has been borrowed 3 times (we have 3 of the same item) or more on a particular day (informing that the item is fully taken).

 

In addition, it would be even better if a flow can be created to also alert the staff managing the loan of the items of the remaining stock of the items, as they are loaned out.

 

I have created this flow but the stock does not seem to be able to be deducted to 0. Is there any way I can add a formula to do so?

 

Thanks!


Flow1.PNGFlow2.PNGFlow3.PNGFlow4.PNGList1.PNG

10 REPLIES 10
manuelstgomes
Community Champion
Community Champion

HI @LIT01 

 

If the SharePoint list column is a number it should be a simple formula.

Can you check if your formula is something like this?

 

sub(body('Get_Inventory')?['{Inventory}'],1)

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

HI @LIT01 

 

Were you able to solve your issue with this solution?

If so please mark it as solved so that people can find it faster.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Hi Manuel

 

The flow seems to work but still inventory number did not update.

 

I have changed the expression to what you have provide and I get this error message under flow checker (see screenshot). Could you please advise what is wrong?


flow checker error.PNG

 

Thanks.

HI @LIT01 

 

Can you show me the formula you're using? 

 

I'm sure it's some detail in the formula that is not helping here.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Hi Manuel

 

What I meant was that I used your formula and it still did not work.

Hi @LIT01 

 

I was checking your previous screenshots and noticed that you have the ID populated with "Inventory". This should contain the "ID" of the "Get The Inventory". This means that you should see an "ID" field there and not "Inventory".

 

Just check your list for the valid ID and run your flow again.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Hi Manuel

 

Please see my list.

 

Have I made the changes correctly?

 

list view.PNGflow ID.PNG

Hi Manuel

 

Any update on the above?

 

Thanks.

Hi @LIT01 

 

Looks good but I can't see the inside of your "sub" function. It should be something like:

 

sub(items('Apply_to_Each')?['Inventory'],1)

 

It should work now 🙂

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel 

Hi Manuel 

 

The flow still didn't manage to reduce the inventory count to 0 on the Sharepoint list.


Can I just check I got the details right? I have these 3 documents:

 

1) A form in Microsoft Forms to book the office item - a card.

2) A Sharepoint List within my Sharepoint page to track the loan of card and the inventory left.

3) The MS Flow process itself

 

Background:

Let's say I have only 1 card in stock.

Staff has to select item type for loan, date borrowing and date returning on the MS form to apply to loan the card.

HR dept has the Sharepoint list stating the information about the 1 card in stock (see my flow).

 

Basic Process:
1. Staff makes application for the card via the MS form.
2. Flow should allow the HR dept to approve the loan of the item if there is still 1 card left.

3. The flow should be able to reduce the inventory count of the card on the Sharepoint list to 0 once it is loaned out.

If the count is at 0, the flow should send an email alert to the staff to decline the staff applying for the card stating that his/her loan is declined.

4. Once the card is returned, the inventory should be able to increase by 1 either by flow (preferably) or manual updating on the Sharepoint list.

 

Could you please advise if the above is doable?

 

Thanks.

 

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.

Users online (1,916)