1

so far I've only read passively. Now it's time for my first post :)

I have a SharePoint-list, which saves stocks for different branchs.

Structure of this list:

Example

It's quite easy to sum the end balance with calculate column in every low (End balance = start balance + Plus - Minus). But how I transfer the end balance (from a previous low) as a default value to a start balance (in a new low / item) automatically? How can the list recognize which previous value belongs to which branch?

Thanks in advance and stay healthy, Snet

New contributor
Snet is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

You could do this by creating a custom form in PowerApps. When you change the branch it will filter the list based on that value and set the default value for 'Balance':

PowerApps form

How i did this

  1. Start by creating a new form. From the top menu, select "PowerApps" and "Customize Forms"
  2. Remove any fields you do not want to display. Simply select the section and press delete.
  3. On your "Start balance" field, click inside the value input, then click "Advanced"
  4. Press the padlock on top that says "Unlock to change properties"
  5. Scroll down to the Default value. In here, add the following formula:
    First(SortByColumns(Filter('List formatting', Branch.Value = DataCardValue4.Selected.Value),"Modified",Descending)).'End balance'

Adjust with own values. In this example, List formatting is the list name, DataCardValue4 is the control from PowerApps that has the branches, End balance is the calculated field. This formula filters the existing list on branch and pulls the newest one (or first one, when sorted by modified date descending...)

  1. I also set the display mode of the field to be DisplayMode.View so that it can't be edited.
  2. When happy with your changes, press the File tab, Save & Publish to SharePoint

Note: You probably want some more logic in here - like when the form is in edit mode. Then you probably don't want your formula to run...

Your Answer

Snet is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.