web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to log transactions?
Power Apps
Unanswered

How to log transactions?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

 

I'm looking in to making a way to automatically log every transaction that is made. For example, my app is for inventory management and the device is being checked in and out. This is the screen that updates the transaction table which just tells me which device is checked out to who, but if i recheck out the device to someone else it will just overwrite that data on that table. I'm looking to make a new table with unlimited rows which can me added every time a new transaction is done, How would you recommend to do this?

 

Thanks!

 

Screenshot - 6_16_2017 , 3_21_05 PM.pngCurrent Table which only tells me which Asset is checked out to who.Current Table which only tells me which Asset is checked out to who.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     

     

    Hi All,

     

    I'm looking in to making a way to automatically log every transaction that is made. For example, my app is for inventory management and seprate devices are being checked in and out. This is the screen that updates the transaction table which just tells me which device is checked out to who, but if i recheck out the device to someone else it will just overwrite that data on that table. I'm looking to make a new table with unlimited rows which can be added every time a new transaction is done, How would you recommend to do this?

     

    Thanks!

    Screenshot - 6_16_2017 , 3_21_05 PM.pngCurrent Table which only tells me which Asset is checked out to who.Current Table which only tells me which Asset is checked out to who.

  • Brian Dang Profile Picture
    3,976 on at

    Switching to a table with unlimited rows is the right way to go. It's more flexible this way and you have longterm data you could use to analyze which assets are being used more/less frequently/how long.

     

    When Patching a record back to the datasource, I assume you want both of these to occur:

    • Check in the device if it has not been checked in yet
    • Check out the device to the next person

    You'll need some conditions around your Patch formula:

     

    If(!IsEmpty(Filter(TransactionsList,AssetTag=AssetOut.Text && CheckedOutTo=StudentIDOut.Text && InOutStatus="Out")),
     Patch(TransactionsList,First(Filter(TransactionsList,AssetTag=AssetOut.Text && InOutStatus="Out")),
     {CheckedInBy: ,
     CheckInDate: Today(),
     CheckInTime: Now(),
     InOutStatus: "In"
     }
     )
    );
    
    Patch(TransactionsList,Defaults(TransactionsList),
     {AssetTag: AssetOut.Text,
     CheckedOutTo: StudentIDOut.Text,
     CheckOutDate: Today(),
     CheckOutTime: Now(),
     InOutStatus: "Out"
     }
    )

     

    This means, "If there exists a record for the given Asset that is still checked out, then take the first matching record and update it to check it in. Regardless, write a new record to check it out."

     

    If you want to prevent an asset from being checked out until it is formally checked in, you can set the Disable property of a Button to:

    !IsEmpty(Filter(TransactionsList,AssetTag=AssetOut.Text && InOutStatus="Out"))

     

    This means, "Disable this button when the given asset has a record which shows it is currently checked out."

     

    Finally, before you make the switch to a datasource whose purpose is to gather unlimited records, I must caution you that Excel has a 500 record limitation. You will be able to write more than 500 records, but only the first 500 will ever be read by PowerApps in its current form. If you need a more robust datasource, I recommend the Common Data Service.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for your reply mr-dang,

     

    I have a few questions about this method.

     

    Will this add rows for each transaction made? or will it just patch and overwrite the record for the asset?

     

    I am looking to do both actually. One table (the one I showed labled Transactions) specific to the number of assets in this example, I have 16, so as the asset is being checked in and out it will only overwrite the record and always have 16 records, that way it will be easy to see what the status of the asset is. In the second table it will be pretty much the same but it will have unlimted rows, im assuming the way to do this is to add rows for each transaction, that way I can see the history of the transactions.

     

    Which will your method achieve?

     

    Thanks so much!

  • Brian Dang Profile Picture
    3,976 on at

    Hi, the formula I wrote would only update a record if there is already one in there; it would check in the device if it is currently checked out--if a record does not have a check in date time (this is the top part of the formula).

     

    In all cases, the formula will always write a new record for the new person checking out the device (second half of the formula after the semicolon). I recommend wrapping it between a condition so that it writes only you want it to.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard