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 / Is it possible to assi...
Power Apps
Answered

Is it possible to assign values to different choices in a combobox?

(0) ShareShare
ReportReport
Posted on by 29

I have a combobox with different choices, lets say A,B and C. I want to assign values to these choices and collect them for a different field. For example A=1, B=2, and C=3. Is this possible and if so could someone point me in the right direction?

 

Thanks in advance.

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    Items property: [{itemName: "A", itemValue: 1},{itemName: "B", itemValue: 2},{itemName: "C", itemValue: 3}]

     

    try using this. This is an array of objects. you would treat it as a collection and would use Selected.itemValues. Cant test this atm but should work! Let me know! 🙂

  • BadCode Profile Picture
    29 on at

    @mmollet 

    Thanks for the help. Now I can choose the items but don't know how to show the itemValue in the text field. Also when I submit the form it doesn't save the choice selected. I'm pretty new to PA so I probably should know this.

     

    My apologies.

  • Verified answer
    mmollet Profile Picture
    3,187 on at

    What you should know is more than yesterday 😉 so as long as you are learning then your current skill matters next to 0! Keep that in mind and just enjoy the software and learn everything you can! 

    Now what you will want to use for this is the dot operator (or period) to access the functions and fields you need. We will start from the 'outside' or with the control name. I am going to assume your textField is a label for now. The labels text field could be set to something like this: DropdownName.Selected.itemValue

    DropdownName -> telling Power Apps which control we want to access data from

    .Selected -> telling Power Apps which item in the dropdown we want to access

    .itemValue -> telling Power Apps which field/column value we want from the selected item in the selected control

     

    I hope this makes sense! If you have more questions post away! This is a great place to learn!

     

    EDIT: Shane Young on youtube, Reza Dorani on youtube, and Warren Belz' blog are some really good places to get some info. If you find a post where Warren comments or answers you will see links to his blog in his signature line. Use these to get a really good start on Power Apps, Power Automate, etc. 

  • BadCode Profile Picture
    29 on at

    Thanks @mmollet 

     

    Now we're cooking. I got it to show the value. I will worry about it saving correctly after I figure this out. So now I have several comboboxes with choices from a SharePoint list. My guess is that I would want to assign all these comboboxes the correct values and add all these itemValue (s) to a collection that sums up all the values. Then display this value in the text field. 

     

    I appreciate you taking the time to clearly educate me. I hit a wall in my development and had to take a break because I was so frustrated. You give me hope!

     

    I watch Shane and Reza's videos all the time. Also gotten a lot of help from Warren and love his blog!

  • mmollet Profile Picture
    3,187 on at

    If you use a gallery you can sum all the items in a column and display it in a text label using the follow code:

    Sum(GalleryName.AllItems, ColumnName)

    if you need to format the ouput to say dollars or something use the Text() function like so:

    Text(Sum(GalleryName.AllItems, ColumnName), "$#0.00") this will show 58 cents as $0.58 etc.

     

    Im not sure if you are using a form. If you are using a form then you would need to change the update property of each data card to use the combobox you added so that it knows what to use when it patches values to your SP List.

     

    If you are not using a form then I assume you are using a patch statment. The only issue you may come across with that is if you are using complex column types in SP Lists such as choice and people columns etc. If you are not then you can just use a patch statment in the same way as normal. If you are using complex columns then you will need different syntax as you are upload an object as a value and not just a string or number. This requires some more code and structuring to achieve. Here is an example of a choice column patch statement:

    Patch(TravelExpenses, LookUp(TravelExpenses, ID=selectedItem.ID), { StatusChoice: {Value: "Approved"} } )

  • BadCode Profile Picture
    29 on at

    @mmollet this is all in a form and I have to different sections I need with totals. I'm trying to figure out how to make a collection add all these values up right now.

     

    One step at a time...

  • mmollet Profile Picture
    3,187 on at

    Text(Value(Sum(GalleryName1.AllItems, ColumnToSum)) + Value(Sum(GalleryName2.AllItems, ColumnToSum)), "format if needed")

    Or without formatting

    Value(Sum(GalleryName1.AllItems, ColumnToSum)) + Value(Sum(GalleryName2.AllItems, ColumnToSum))

     

    Something like those in a label should show the sum of 2 columns from 2 diff gallerys in one location.

  • BadCode Profile Picture
    29 on at

    I don't have any galleries. It's a form feeding off a SharePoint backend. For the second section which is separate can I use [{itemName: "A", itemValue2: 1},{itemName: "B", itemValue2: 2},{itemName: "C", itemValue2: 3}] ?

  • mmollet Profile Picture
    3,187 on at

    Not sure what you mean. What are you trying to sum if you only have one item from a SP List in a form? Also not sure what you mean by "second section which is separate". Sorry I might have missed something you said before that would explain that. 

  • BadCode Profile Picture
    29 on at

    Let me see if I can elaborate what I'm talking about. I have a form with 2 different sections (by sections I mean just 2 seperate groups of comboboxes with different totals). Each section has several comboboxes, some multiselect and some single. Each choice in the comboboxes has to be assigned a value of 1-5. I have a SharePoint number column that has to show the totals of the values of each section according to what was selected in the comboboxes. Something that I could whip up quickly in an excel spreadsheet is frustrating me beyond belief!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard