web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Calculate a price base...
Power Apps
Answered

Calculate a price based on selected text choices?

(0) ShareShare
ReportReport
Posted on by 45

Hi,

Please note that I'm new to PowerApps as well as this community. I hope I do everything right 🙂

 

I'm creating a meeting order form for ordering food and drinks. I'm connecting to a SharePoint list from Powerapps. In the SharePoint list I have several choice fields, one of them being food items that can be selected(multiple selections are allowed). For each food item selected I then want to multiply the base price(which I currently don't have anywhere in the SharePoint list) of the item with the number of people attending the meeting. The prices should then be added to create a total cost of food and drinks for the meeting.

 

My problem is that I have no idea how to do this. I have looked at the Datacardvalue.selected.value, but I need numbers, not the text saved in the choice.

I'm not expecting anyone to provide me a "turn-key solution" to this but if anyone can at least point me in the right direction it will be a big help 😊

 

Best regards,
Ken

Categories:
I have the same question (0)
  • rbrooks66 Profile Picture
    143 on at

    Use the Value(FieldName.Text) to convert a text to a number.  Here's a link to the functions available in Power Apps,

    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-value

     

    Screenshot 2022-07-19 081327 Value.png

  • DSKJ Profile Picture
    45 on at

    Thank you for you quick reply @rbrooks66, but my problem is that when the the food item are chosen they have values like "Banana", "Coffee" etc. I cannot convert those to numbers.

    Sorry if that was not clear in my initial post.

  • Verified answer
    JK6 Profile Picture
    15 on at

    Hi!

     

    Just to get you started, I created a quick example on what could be the possibility to do.

     

    I would create a separate list,. e.g. FoodPrices

    JK6_0-1658233905571.png

    Create a connection with that in the application

    JK6_1-1658233970980.png

    Here, in FoodItems (thats the choice field that comes from the main list) I select a food item, in the Attendees I write the number of people (here for the example this is just a Number type column in SP) and then in PriceTotal it calculates the FoodPrice (from the new created list FoodPrices) * Attendees number (3 in this case).

    JK6_2-1658234025294.png

    In the PriceTotal function bar, I have this function:

    LookUp(foodPrices, DataCardValue2.Selected.Value = Title).Price * DataCardValue3.Text

    a LookUp funtion, that retrieves the price if the condition is met. The condition is that the selected value in the field FootItems (in this case it's "bread") is the same item in the new created list FoodPrices and then it times by attendees.

    JK6_3-1658234366886.png

    In the main list looks like this.

     

    But this is a very quick and easy solution, not taking in account any complicated stuff you might need in the background etc.

  • DSKJ Profile Picture
    45 on at

    Thanks a lot @JK6 looks like that will work for me 🙂

    Br Ken

  • DSKJ Profile Picture
    45 on at

    Hi again,

    Well, the solution works - partly 🙂 
    My choice field can have multiple selections and the lookup does not support that. I only get the value of the last selected food item. I tried messing around with a filter, but either my syntax is incorrect or It's not really what I should use.

    Any idea on how to solve that?

    BR Ken

  • Verified answer
    DSKJ Profile Picture
    45 on at

    I decided to redo the solution. Instead of a multiple choice field I opted to go for several checkboxes(1 per food item). It's then trivial to do calculations based on true/false of each item.

    I'll mark this as solution to make it easier for other people having the same issue

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard