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 / Get multiple values fr...
Power Apps
Answered

Get multiple values from a combo box

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone,

I have created a combo box with multiple selection.  

'Budget Month':LookUp(displayItem.'Budget Months', Month= Concat(comboBoxMonth.SelectedItems,Value,", "))

 

 ok.JPG

My scenario is user will be able to select multiple months to copy a set of data. 
But I am trying to get separate value from combobox instead of one. How do I do that?
Eg: 9 and 10 not 910

Thanks in advance!

Categories:
  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

     

    Similar is been answered this post check it please Combobox multiple selection 

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Ramole,

    I have checked the post before unfortunately it does not help me in my case.
    Thanks. 

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Could you please tell me that

    1. if you want to display multi value in a Label based on the LookUp() formula or other else?
    2. If the month column is a Choice or Text type?
    3. do you set the comboboBoxMonth with hard code like ["1","2","3",...]?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-qiaqi-msft ,

    1. I actually wanted to use the selected values for my global variable which is to trigger a timer to recalculate the amount and update/duplicate the data to my DataSource based on the selected month.

    Below is snippet code in my onSelect button:

    // update to specified month
    UpdateIf(NewRecords, true, {
     'Budget Month':LookUp(displayItem.'Budget Months', Month = Switch(Concat(comboBoxMonth.SelectedItems,Value,", "),"January", "1", "February", "2", "March", "3", "April", "4", "May", "5", "June", "6", "July", "7", "August", "8", "September", "9", "October", "10", "November", "11", "December", "12"))
    });
    
    // create batch record
    Patch('Forecast Items', NewRecords);
    //trigger a timer to recalculate the amount based on selected months
    Set(MonthToCopy, Concat(comboBoxMonth.SelectedItems,Value,", "));
    Set(RecalculateForecast, true);


    here is my Timer OnStart property:

    UpdateContext({
    TotalForTheMonth:Sum(Filter(...),
     RecordToUpdate:LookUp('Budget Record', ...)
    });
    If(IsBlank(MonthToCopy), Set(MonthToCopy, txtMonth));
    If(IsBlank(TotalForTheMonth),UpdateContext({TotalForTheMonth:0}));
    
    Switch(MonthToCopy,
    "January",Patch('Budget Record',RecordToUpdate,{'Jan Forecast':TotalForTheMonth}),
    .........
    "December",Patch('Budget Record',RecordToUpdate,{'Dec Forecast':TotalForTheMonth});
    );



    2. My month column is a text type with value of (1-12)

    3. and no my comboBoxMonth Item property is a filter from a Collection which displays the future month based on the current month..(August, September etc...)


    For now all my function/formulas are working well but only when user select one month.

    Now, my issue is I wanted to be able to select multiple months to duplicate my data and I've realized I might have to loop through the items in comboboxMonth. I am not sure what the best approach and would appreciate the feedback from you about this. Thank you!

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    I find your question is just like the Russian nesting dolls, one ring in front of the other😂.

    I think you want to patch comboBoxMonth selected months to the 'Budget Month', like you select 9,10 from the comboBoxMonth, and you want the 'Budget Month' column displays 9,10, right?

    If so, the LookUp() formula expects a Text value rather than a record value. Based on this, I think you should modify your formula as below:

    Concat(
     ForAll(
     comboBoxMonth.SelectedItems,
     Switch(
     Value,
     "January",
     "1",
     "February",
     "2",
     ...
     )
     ),
     Value,
     ","
    )

    On your side, please modify as below:

    UpdateIf(NewRecords, true, {
     'Budget Month':Concat(ForAll(comboBoxMonth.SelectedItems,Switch(Value,"January", "1", "February", "2", "March", "3", "April", "4", "May", "5", "June", "6", "July", "7", "August", "8", "September", "9", "October", "10", "November", "11", "December", "12")),Value,",")})

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @v-qiaqi-msft ,

    Haha my bad! I hope I don't confuse you (as confused as I am...)
    Anyway, I have finally figured out the solution to loop by using ForAll() and create a new record collection based on the specified month..

    ForAll(comboBoxMonth.SelectedItems, 
    
     UpdateIf(CopyItemRecord, true, {
     'Budget Month':LookUp(displayItem.'Budget Months', Month = rowMonth),
     Date:Date(Value(dropdownYear.Selected.Value), Value(rowMonth), 1)
     });
     // create new record collections
     Collect(NewRecords, CopyItemRecord);
    );
    
    // create batch record
    Patch('Budget Forecast', NewRecords);

     
    Thanks again! 😄

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 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard