cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Hizmoheel1307
Level: Powered On

Lookups on Custom Form with Calculation.

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.
1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: Lookups on Custom Form with Calculation.

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.

View solution in original post

6 REPLIES 6
PowerAddict
Level 10

Re: Lookups on Custom Form with Calculation.

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
Level: Powered On

Re: Lookups on Custom Form with Calculation.

@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.
v-siky-msft
Level 10

Re: Lookups on Custom Form with Calculation.

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.

View solution in original post

Hizmoheel1307
Level: Powered On

Re: Lookups on Custom Form with Calculation.

@v-siky-msft 

 

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

Hizmoheel1307
Level: Powered On

Re: Lookups on Custom Form with Calculation.

@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

 

 
Hizmoheel1307
Level: Powered On

Re: Lookups on Custom Form with Calculation.

@v-siky-msft

 

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,899)