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.

 

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