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 / Lookups on Custom Form...
Power Apps
Answered

Lookups on Custom Form with Calculation.

(0) ShareShare
ReportReport
Posted on by 12
I have a SharePoint list I'm trying to customize with custom form. This list contain many columns. One of the columns is a Lookup field(Multi Selection) which look up to another SharePoint list with two columns. For example product and price.
So what I'm trying to achieve is when ever they select any product from the main list it should set default value of one of the columns from the main list to the corresponding price which I have done but when they select multiple products I want to add the prices of the selected products and should set default value of one of the columns from the main list to the corresponding sum which will be submitted as well. In addition, user can as well un select a particular product before submission so the calculation should change automatically.

Kindly assist. In case my explanation is not please let me know. I will rephrase.

Thank you.
Categories:
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Just to make sure I got it right: 

     

    1. There is a combo box that allows users to select products from the main list

    2. If they select one item from the product main list, it should set the default value of say ColumnA in the main list to the price of the product selected in the product main list (fetched from the product/price list)

    3. If they select more than one item from the product main list, it should set the default value of the same column, ColumnA in the main list to the sum of the prices of the products selected in the product main list

     

    Is that correct? If so, I will share a solution describing how to achieve this. 

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit(Haman)

  • Hizmoheel1307 Profile Picture
    12 on at
    @PowerAddict
    Yes, it's correct. One more thing is that the user may decide to remove remove/unselect any product before submission and Column A should automatically reflect the current sum of the selected products.

    Thank you so much. I will expecting the solution as stated.
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Hizmoheel1307 ,

     

    I have made a test on my side, you can refer to the following steps.

    1. Add the related SharePoint list to data source(another SP list you look up)

    2. Set OnChange property of combobox in Product DataCard as below, create a collection to store each items' price

     

    ClearCollect(col_price,ForAll(DataCardValue1.SelectedItems,LookUp('Related SP list',ID=Id).price))

     

    3. Set the Default property of textinput box in SumPrice DataCard as below, calculate the summary of  price collection.

     

    Sum(col_price,Value)

     

     Annotation 2019-11-14 101522.png

    Best regards,

    Sik

    If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

  • Hizmoheel1307 Profile Picture
    12 on at

    @v-siky-msft 

     

    I really appreciate you for taking your time to help me resolved this. Unlimited kudos to you.🤗

  • Hizmoheel1307 Profile Picture
    12 on at

    @v-siky-msft

     

    One more thing please,

    I couldn't save using default SharePoint save button, i even created a save button getting the below error on submission.

     

    Please assist

     

     
    Testtttt12PNG.PNG
    Testtttt1.PNG
  • Hizmoheel1307 Profile Picture
    12 on at

    @v-siky-msft

     

    Please reply to my last message. I can't save it to SharePoint list after getting the summation.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard