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 / Multiple Select in Com...
Power Apps
Unanswered

Multiple Select in Combo Box to Batch Upload in SQL

(0) ShareShare
ReportReport
Posted on by 17

I've built an app that publishes different text box values into separate columns on an SQL database, when a button is pressed. Currently, each time the user fills the app and presses the button, the values go into a new row.

 

I am looking to use the multiple select on the combo box to batch upload values. The problem I am having is I don't know how to place the value into a separate row for each selection in the combo box.

 

For example, I fill out the sheet and select Austria as the market and the text box concatenates the values as:

  • client-region-division-channelcategory-strategy-AT-campaign-1903

I then press the button and the name is added.

 

I change Austria to Belgium, press button, new row is created with new name and client-region-division-channelcategory-strategy-BE-campaign-1903 is added.

 

I'm looking to select Austria, Belgium, Croatia, Norway, etc. all at once and then press the button to add them all at once on separate rows like so:

  • client-region-division-channelcategory-strategy-AT-campaign-1903
  • client-region-division-channelcategory-strategy-BE-campaign-1903
  • client-region-division-channelcategory-strategy-HR-campaign-1903
  • client-region-division-channelcategory-strategy-NO-campaign-1903

These will all be in the same column, with other filled out text box values going into their relevant columns too i.e. the placement name will be the same but added to each market (see SQLcode.PNG)

 

Is this possible? Any help would be greatly appreciated.

 

Thank you

 

SQLcode.PNG
buttonCode.PNG
Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    HI @Mammoth ,

    Could you please share a bit more about your scenario?

    How do you concatenate the Compaign Name text within your app?

    Do you concatenate the Compaign Name text within your app based on the selected value within the Market ComboBox?

    Further, could you please share a bit more about the formula you typed within the Default property of the Campaign Name Text Box in your Edit form?

     

    I assume that the Compaign Name text within your app is based on the selected value within the Market ComboBox, is it true?

    Based on the needs that you mentioned, I think ForAll function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

    Set the Items property of the Market Combo Box (ComboBox1) to following:

    ["Austria", "Belgium", "Croatia", "Norway"]

    Set the OnSelect property of the "Submit" button to following:

    ForAll(
     ComboBox1.SelectedItems,
     Patch(
     '[dbo].[database]',
    Defaults('[dbo].[database]'),
    {
    AdvertiserName: AdvertiserName_DCM.Text,
    CampaignName: Concatenate("client-region-division-channelcategory-strategy-", Value, "-campaign-1903"), /* <-- Concatenate CampaignName Text based on the Value from ComboBox1.SelectedItems */
    Placement_x0020_Name: PlacementName.Text,
    ...
    } ) )

    More details about ForAll function in PowerApps, please check the following article:

    ForAll function

     

    Best regards,

     

  • scxttd Profile Picture
    17 on at

    Hi @v-xida-msft,

     

    I concatenate the campaign name using the 'concatenate' function and the values from each combo box that the user can select (the first four selction boxes are drop down boxes, the last is a text input box and the rest are combo boxes).  

    Concatenate(
     ddBusiness_CamDCM.Selected.Value, "-",
     ddRegion_CamDCM.Selected.Value, "-",
     ddDivision_CamDCM.Selected.Value, "-",
     ddChannel_CamDCM.Selected.Value, "-",
     ddCategory_CamDCM.Selected.Result, "-",
     ddStrategy_CamDCM.Selected.Result,"-",
     ddMarket_CamDCM.Selected.Code, "-",
     ddCampaign_CamDCM.Selected.Result, "-",
     YYMM_CamDCM.Text)

    So the ForAll function you suggested does add seperate number of campaign names for the number of markets you select. However, if I select "AT", "DE", "FR", "BE" (random order), in SQL, the campaign name populates four campaigns, but the all have BE:

    • client-client-client-client-region-region-BE-creative type-1212
    • client-client-client-client-region-region-BE-creative type-1212
    • client-client-client-client-region-region-BE-creative type-1212
    • client-client-client-client-region-region-BE-creative type-1212

    I know why this is happening, I am using this formula within the ForAll and Patch functions:

    CampaignName: Concatenate(
     ddBusiness_CamDCM.Selected.Value,"-",
     ddRegion_CamDCM.Selected.Value,"-",
     ddDivision_CamDCM.Selected.Value,"-",
     ddChannel_CamDCM.Selected.Value, "-",
     ddCategory_CamDCM.Selected.Result,"-",
     ddStrategy_CamDCM.Selected.Result,"-",
     ddMarket_CamDCM.Selected.Code,"-",
     ddCampaign_CamDCM.Selected.Result,"-",
     YYMM_CamDCM.Text
    )

    Since BE was the last value I selected and I use ddMarket_CamDCM.Selected.Code, that's why BE is the only value to be used. I tried ddMarket_CamDCM.SelectedItems.Code and got an error.

     

    Any idea how I can get each market in a different row, as apposed to the last market that was selected on all rows?

     

    Thanks,

    Mammoth

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard