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

Add Column to Collection from Dropdown Selection

Hello all,

 

I'm attempting to build an app that will allow a warehouse associate to scan received boxes and ultimately upload the serial numbers from those boxes to a SharePoint list.  Additionally, after scanning the boxes and creating the initial collection, I'd like to add the ability for them to select their location from a dropdown and have that create a column with the location data on each row in the collection

 

I have the app functioning up to this point:

  1. user can scan the serial numbers to a text input field and then stores those numbers  as a collection
    • storeNumbers.png
  2. text field is being split (the scanner adds a ; suffix to each scan) using this formula: ClearCollect(scannedNumbers,Split(scanned.Text,";"))
  3. at this point the user has a collection that looks like this
    • collection.png
  4. after clicking next, they are brought to a screen and can select a location from the drop-down.  This is the part that is not currently working.
    • I've tried the following formulas to add this behavior but I can't get it to work.  Either it doesn't add the information or I get a prompt that the column 'location' already exists:
      • ClearCollect(scannedNumbers,"location",'Loc.dropDown'.Selected.Value)
      • ClearCollect(scannedNumbers,AddColumns(scannedNumbers,"location",'Loc.dropDown'.Selected.Value))

Any help would be appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Conan
Level: Powered On

Re: Add Column to Collection from Dropdown Selection

Okay - I feel like I have this fixed now.

 

I did the following from a high-level:

 

  1. Created initial collection "scannedNumbers" by splitting string
    • ClearCollect(scannedNumbers,Split(scanned.Text,";"))
  2. Created new collection "submitNumbers" by adding a column to "scannedNumbers" from the dropDown selected value
    • ClearCollect(submitNumbers, AddColumns(scannedNumbers,"location",'Loc.dropDown'.Selected.Value))
  3. This yielded the result I was expecting
    • collection3.png
3 REPLIES 3
Super User
Super User

Re: Add Column to Collection from Dropdown Selection

The code examples you provided would actually clear out all the scanning values. If you want to add the location information to each row in the collection try something like this:

 

AddColumns(scannedNumbers, "location" , LocationDropDown.Selected.Value)

You will need to change the name "LocationDropDown" to the name of your locations drop down control.

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Conan
Level: Powered On

Re: Add Column to Collection from Dropdown Selection

Thanks, I have this as the fx for the DropDown

 

AddColumns(scannedNumbers,"location",'Loc.dropDown'.Selected.Value)


but in the collection all I see is the value gathered at the first button select
collection2.png

Conan
Level: Powered On

Re: Add Column to Collection from Dropdown Selection

Okay - I feel like I have this fixed now.

 

I did the following from a high-level:

 

  1. Created initial collection "scannedNumbers" by splitting string
    • ClearCollect(scannedNumbers,Split(scanned.Text,";"))
  2. Created new collection "submitNumbers" by adding a column to "scannedNumbers" from the dropDown selected value
    • ClearCollect(submitNumbers, AddColumns(scannedNumbers,"location",'Loc.dropDown'.Selected.Value))
  3. This yielded the result I was expecting
    • collection3.png

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 62 members 4,408 guests
Please welcome our newest community members: