Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Connection/Links between several sp lists

(0) ShareShare
ReportReport
Posted on by 26

Hi all,

 

i created my first powerapp to a sharepoint list. here i can see and edit my articles, stock and so on and that works fine. 

now i created a second list in sharepoint where i want to track my sales. i have already a link where i can edit the fields of the new sales list. the problem that i have here is: i want a connection between my stock and my sales list and dont know how to do it.

 

for example: if i am in my app in my stock list and click on sell (opens edit mode for sales list *this works) 2 fields (article numer and article description) should be already filled in the fields related to the item i selected. and when i sell the item i have a field (sales list) for the order quantity which should than automaticly reduce my stock in the stock list for that value of the quantity order.

 

i hope that expressed myself understandable

 

thanks for any advice

Categories:
  • PytByt Profile Picture
    943 on at
    Re: Connection/Links between several sp lists

    i still dont understand... 

     

    how can i possibly linked 2 different SP list into viewing just 1 SP list based on another list?

     

    i need the exact formula... 

     

    thanks,

     

    Ps. i am a super newb BTW


    @craetion wrote:

    Hi @v-yamao-msft,

     

    thanks for your help. I've solved the problem! 

     

    From the stock screen i navigate to the sales screen and give all needed fields as context further like this: 

     

    NewForm(SalesForm);;Navigate(SalesScreen; ScreenTransition.Fade; {ArtNr:ThisItem.Title; "more transition fields"})

    Now I can just write in my edit field article just "ArtNr" and it will automatically autofill the article number related to the selected item.

     

    Then I fill in my sales form with the order quantity and adjust my new stock minus order quantity via patch function on submit like this:

     

    SubmitForm(SalesForm);;Patch( Stock; {ID: Id} ; {Stock: InitStock - SalesForm.LastSubmit.Order Quantity})

     

    and I have now my desired functions!

     

    Thanks for help 😃

     

     


     

  • Verified answer
    craetion Profile Picture
    26 on at
    Re: Connection/Links between several sp lists

    Hi @v-yamao-msft,

     

    thanks for your help. I've solved the problem! 

     

    From the stock screen i navigate to the sales screen and give all needed fields as context further like this: 

     

    NewForm(SalesForm);;Navigate(SalesScreen; ScreenTransition.Fade; {ArtNr:ThisItem.Title; "more transition fields"})

    Now I can just write in my edit field article just "ArtNr" and it will automatically autofill the article number related to the selected item.

     

    Then I fill in my sales form with the order quantity and adjust my new stock minus order quantity via patch function on submit like this:

     

    SubmitForm(SalesForm);;Patch( Stock; {ID: Id} ; {Stock: InitStock - SalesForm.LastSubmit.Order Quantity})

     

    and I have now my desired functions!

     

    Thanks for help 😃

     

     

  • v-yamao-msft Profile Picture
    on at
    Re: Connection/Links between several sp lists

    Hi craetion,

     

    When you click on Sell button, you will be navigated to the Sales screen. At here, you could consider to use Navigate function and transform the selected article to Sales screen.


    Please see this doc for more details:
    https://powerapps.microsoft.com/en-us/tutorials/function-navigate/

     

    Then on the Sales screen, you could consider to use Lookup function to lookup for the description of the article, and configure a function similar with the one I posted before to calculate order quantity.


    Please try it on your side. If you need more help, please feel free reply.

     

    Best regards,
    Mabel Mao

  • craetion Profile Picture
    26 on at
    Re: Connection/Links between several sp lists

    Hey Mabel, 

     

    thanks for your answer, i think this is the right way but im not sure if this will work the way it should be or im not able to implement your suggestion right 🙂 here are some screens:

     

     

    My stock list shows me all my articles with the number, description and stock (1,13,168).

    When i now click on sell, i navigate to my sales list. and i want here that the article number and description will be already filled to the choosen item from the stock list and also will calculate the order quantity automatically from the stock.

     

    For example: 

     

    I sell 3 items of article 1234. Have a stock of 5. 

    - In the STOCK list in sharepoint the new stock should now be on 2.

    - In the SALES list in sharepoint i should see the sold article with the description and order quantity (3) to which customer i have sold it.

     

    Thanks in advance.

    Best regards!

  • v-yamao-msft Profile Picture
    on at
    Re: Connection/Links between several sp lists

    Hi craetion,

     

    Please try if following steps could achieve your needs.


    According to your description, I create two lists, one for Sales, another one for Stock.


    Create an app based on Sales list automatically.


    Add a new screen then add a Gallery control on it, set its data source as Stock list.


    Add more two labels. In my case, Label3 and lable4.


    Set Lable3’s Text property as ThisItem.StockColumnName.


    Set Label4’s Text property as Label3-LookUp(Sales,Title=ThisItem.Title,OrderQuantityColumnName)


    Then the order quantity would be automatically reduced from the total stock if they have the same Title.


    About Lookup function, please see this doc for more details:
    https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

     

    Please try it on your side and feel free reply if you need more help.

     

    Best regards, 
    Mabel Mao

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,708 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,030 Most Valuable Professional

Leaderboard