cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Problems saving multiple choice lookup to SP List

I've run into a problem that I cant seem to get my head around! I'm pretty new to PA still...

 

I have a form that has multiple lookups, they all worked absolutley fine until I made a couple of them multiple choice. The ComboBoxes save their results to the SP list fine, but the lookup columns that allow multiple selections are only saving one item to the list.

 

Current settings:

Update on DC =

 

{
Id: LookUp('Contract Address CostCode List', ddAMQFM.Selected.Result = Contract,ID),
Value: ddAMQFM.Selected.Result
}

 

 Items on ddAMQFM =

 

Sort(Distinct('Contract Address CostCode List',Contract),Result)

 

 As I've said, this works but it's only saving a single item to the SP colunm and I need to to save all items that the user selects.

 

I've come across posts mentioning the renaming of columns as a workaround but I havent been able to get this to work so would appreciate any help on this one!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

@Doddy83 

I don't think the dependent dropdown matters, not sure really. I was able to construct a similar test setup to yours that updated the Multi choice column correctly.

 

My setup:

Multi choice ComboBox called 'cboxMultiColumn', set up as

Sort(Distinct(myListName,myColumnName),Result)

 

Update on DataCard

ForAll(cboxMultiColumn.SelectedItems,
      {Id: LookUp(myLOOKUPListName, columnName=Result,ID),
      Value: cboxMultiColumn.Selected.Result
      }
)

To update, I just used 

SubmitForm(myFormName)

 

The two main differences comparing my code to yours is that:

1. Using ForAll() to collect all the options selected, and

2. Referencing the LookUp List (not the same List where you get your Distinct values from) to get the ID. This is important.

 

Let me know if you can get this working. I'm happy to help further if you need me to.

 

Cheers

View solution in original post

7 REPLIES 7
Highlighted
Super User II
Super User II

@Doddy83 

Are you saying that you had a couple of LookUp columns set as single choice then changed these to Multi Choice columns? If so, I'd avoid doing this just because of the headaches it creates. I usually create whole new columns if I need to change a column Data Type or feature, such as this.

 

That being said, you could try a few things.

1. Remove the connection to the SP list

2. Remove the offending Datacard/s from your form

3. Re-add the SP List connection back

4. Re-add the Multi choice columns back into your form

 

Not sure this will work but it may? If it does, the Update of your DC and the Items of you DC should be setup correctly and you shouldn't need to change anything

Highlighted

@Eelman 

 

Hello, thank you for the reply, unfortunately it didnt make any difference. I've removed the connection from the PA, re-created the columns as multi select from the start and re-added to app. (I had tried this before as I too found the problems with changing column setting).

 

I did test it before I put in the filter in Items of the DD and the lookup in the Update of the DC and it did save all the selections to the list. Once I added in these parts to make the list distinct and set the Update control it now only saves a single choice to the SP list?

Highlighted

I should probably also mention that the one of the lookups is a dependant dropdown

Highlighted
Super User II
Super User II

@Doddy83 

I don't think the dependent dropdown matters, not sure really. I was able to construct a similar test setup to yours that updated the Multi choice column correctly.

 

My setup:

Multi choice ComboBox called 'cboxMultiColumn', set up as

Sort(Distinct(myListName,myColumnName),Result)

 

Update on DataCard

ForAll(cboxMultiColumn.SelectedItems,
      {Id: LookUp(myLOOKUPListName, columnName=Result,ID),
      Value: cboxMultiColumn.Selected.Result
      }
)

To update, I just used 

SubmitForm(myFormName)

 

The two main differences comparing my code to yours is that:

1. Using ForAll() to collect all the options selected, and

2. Referencing the LookUp List (not the same List where you get your Distinct values from) to get the ID. This is important.

 

Let me know if you can get this working. I'm happy to help further if you need me to.

 

Cheers

View solution in original post

Highlighted

Sorry for the delay but thank you so much for spending the time to find a solution!

Highlighted

May have marked as resolved a bit quick!

I've just tried this on another dependant drop down but I cant get it to work. I went in another direction previously so couldnt try your formula but I've just added another set of questions and it's another dependant drop down and this time I do need them to be able to pick and save multiple Sites, but only one contract.

So I have two questions, one is for contract (single choice), the other for site (multi choice):

 

Contract setup

Items for Drop Down:

Sort(Distinct(SPLookupListName,ColumnName),Result)

 (I've tried this not using the lookup list but that doesnt work, only seems to work when I point this at the actual lookup list?)

 

Update on DataCard:

ForAll(ddAMBMSContract.SelectedItems,
{Id: LookUp(SPLookupList,ColumnName=Result,ID),
Value: ddAMBMSContract.Selected.Result
}
)

This i have copied and pasted and manually typed out and it all looks good until I put the last ) in , then the formual errors saying 'Expected Record value. BMSContractAccess_DataCard1.Update' and this is the DC containing ddAMBMSContract.

Highlighted

Igmore, I'm being an idiot an adding the formula to the wront DC! It works a treat!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,596)