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 / Gallery to show multip...
Power Apps
Answered

Gallery to show multiple Values IN tables

(0) ShareShare
ReportReport
Posted on by 16

Hello Everyone,

I have 3 SharePoint lists. 
Is it possible to have your main Stocks gallery show multiple linked fields from 3 tables?  

also is it possible my data in this gallery be like this  

 

Stocks Gallery 
     QuantityOFITEMFinal (QuantityOFITEM + QuantityOFITEMIN- QuantityOFITEMOUT )                     

ITEM_NAME     QuantityOFITEM    QuantityOFITEMIN     QuantityOFITEMOUT      QuantityOFITEMFinal
PEN                       50                                         20                                     

12                                             

58
     
     
     

 

Item

ItemIDITEM_NAMEQuantityOFITEM
1PEN50
2Toner20
3USB 30

 

Purchase orders

ItemIDIteminQuantityOFITEMIN
1PEN20
3USB15
3USB30
   

 

 

STOCKOUT

ItemIDItemsoutQuantityOFITEMOUTBranchName
1PEN12MAIN BRANCH
3USB11Second Branch
3USB25Third Branch
    

 

 

any Help? 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,300 Most Valuable Professional on at

    Hi @mahmouddahbour ,

    I will refer to your lists as List1, List2 & List3 and assume you have the ITEM_NAME in a Text Box called txtITEM (you will need to change the reference depending on where you have this).

    This sets the Variable  QuantityOFITEMFinal to the total of the three list items.

    Set(
     QuantityOFITEMFinal,
     Lookup(
     List1,
     ITEM_NAME = txtITEM.Text,
     QuantityOFITEM
     ) +
     Lookup(
     List2,
     ITEM_NAME = txtITEM.Text,
     QuantityOFITEMIN
     ) +
     Lookup(
     List3,
     ITEM_NAME = txtITEM.Text,
     QuantityOFITEMOUT
     ) 
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @mahmouddahbour ,

    Do you want to merge three lists to one list?

    Does Stocks contain QuantityOFITEM field, Purchase orders contain QuantityOFITEMIN field, STOCKOUT contain QuantityOFITEMOUT field?

    Could you tell me the data type of 

    1)ITEM_NAME, QuantityOFITEM in Stocks list?

    2)Itemin, QuantityOFITEMIN in Purchase orders list?

    3)Itemsout, QuantityOFITEMOUT in STOCKOUT list?

    I assume that:

    1)ITEM_NAME( text type), QuantityOFITEM(number type) in Stocks list.

    2)Itemin( text type), QuantityOFITEMIN(number type) in Purchase orders list.

    3)Itemsout( text type), QuantityOFITEMOUT(number type) in STOCKOUT list.

     

    I suggest you build a collection with the merged data, set the screen's OnVisible:

    ClearCollect(collection1,
    AddColumns(Stocks,"QuantityOFITEMIN",0,"QuantityOFITEMOUT",0)
     );
    //create a collection with the data of stocks and add two columns with blank value
    
    ForAll('Purchase orders',
     Patch(collection1,
     LookUp(collection1,ITEM_NAME=Itemin),
     {QuantityOFITEMIN:'Purchase orders'[@QuantityOFITEMIN]} 
     )
     );
    //use 'Purchase orders' to update QuantityOFITEMIN value in collection1
    
    ForAll(STOCKOUT,
     Patch(collection1,
     LookUp(collection1,ITEM_NAME=Itemsout),
     {QuantityOFITEMOUT:STOCKOUT[@QuantityOFITEMOUT]} 
     )
     );
    //use STOCKOUT to update QuantityOFITEMOUT value in collection1
    AddColumns(collection1, "QuantityOFITEMFinal",QuantityOFITEM + QuantityOFITEMIN- QuantityOFITEMOUT)

    Firstly, use Stocks list to create a collection, then use the other two lists to update this collection. Then add a column by using the formula:  QuantityOFITEMFinal (QuantityOFITEM + QuantityOFITEMIN- QuantityOFITEMOUT )

     

    The collection1 will be the final table that you want.

    You just need to set the gallery's Items to collection1.

     

     

    Best regards,

  • WarrenBelz Profile Picture
    155,300 Most Valuable Professional on at

    Thank you @v-yutliu-msft for the alternate model.

    @mahmouddahbour , I am assuming you simply want to add the three totals together (that was you question) - if you want to do something else, happy to assist.

  • mahmouddahbour Profile Picture
    16 on at

    hi @v-yutliu-msft  @WarrenBelz 
    thank you so much for the response  


    this my first App in Powerapps so I'm trying to build an inventory and stocks, I have these 3 lists.
     please let me know if something wrong with my Data.
    111.PNG


    222.PNG

     

    333.PNG

     

    333.PNG
    111.PNG
    222.PNG
  • WarrenBelz Profile Picture
    155,300 Most Valuable Professional on at

    @mahmouddahbour ,

    You have marked this as solved - I am not sure what your question is.

  • mahmouddahbour Profile Picture
    16 on at

    333.PNG

    @WarrenBelz  my question is when I put this lookup function it gives this error invalid argument type 

    so I Try replace it with   
    ForAll(STOCKOUT,
    Patch(collection1,
    LookUp(collection1,ItemID=ItemID),
    {QuantityOFITEMOUT:STOCKOUT[@QuantityOFITEMOUT]}
    )

    still not work.

     

  • WarrenBelz Profile Picture
    155,300 Most Valuable Professional on at

    @mahmouddahbour ,

    I will have to leave you with @v-yutliu-msft on this as I would do this a different way.

  • mahmouddahbour Profile Picture
    16 on at

    @v-yutliu-msft  I Hope You Answer The Question. 

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @mahmouddahbour ,

    Please tell me the fields data type that are used in the formula.

    It seems that two sides are different data type.

    Please notice my assumption in my previous reply.

     

     

    Best regards,

  • mahmouddahbour Profile Picture
    16 on at

    @v-yutliu-msft  Here is the data type :

    Item list :

    item.PNG

     

    Purchasesorders List : 

    order.PNG

     

     

    STOCKOUT List 

    stock.PNG

     

    Regards 

    order.PNG
    stock.PNG
    item.PNG

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard