Hi
I have a countries list which is the "Items" property of a combobox.
I select 3 countries, Barbados, Bermuda and Antigua (sorry England are in the West Indies playing Cricket). I submit my Form. All is OK.
I then reload my form.
I then delete Bermuda from my list of Selected Contries in the ComboBox.
In the OnChange Event, If I look at combobox.Selected Items then I get two completely blank lines.
How can I find out which item was deleted from the list of selected countries. (or what are the remaining items which are still selected ?)
Similarily if I add a fourth country say St Lucia combobox.SelectedItems has four entries. Three completely blank and a fourth with St Lucia in it. How can I find what the other 3 items are ?
Thanks
Nigel
Solved! Go to Solution.
Hi @v-xida-msft
I have finally got it working !!
The clue was that Collection1 had a list of fields non of which were "Value" !
So a spot of judisious renaming of columns sorted it.
1) ClearCollect(collCountries, Countries);
2) Items property of Combobox set to RenameColumns(collCountries,"Country_x0020_Name0","Value")
3) In data table set field to display to be "Value"
Then it all worked.
Thanks for all of your help.
Nigel
Hi @NigelP,
Could you please share a bit more about your issue?
Further, do you want to find out which item has been deleted from the list of selected countries within the Combo Box control?
Which column does the Combo Box connect to? A Choice type column or LookUp column in your SP list?
I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:
Set the OnChange property of the Combo Box within the Project Type Data card to following:
ClearCollect(Collection1, DataCardValue9.SelectedItems)
Please check the attached GIF screenshot for more details:
If you want to find out which item has been deleted from the list of selected countries within the Combo Box control, you could consider add a Data Table control within your Edit screen, set the Items property to following:
Collection1
If the issue still exists, please consider take a try to re-create/re-generate an app based on your data source, then check if the issue is solved.
Best regards,
HI @v-xida-msft
Thanks for coming back to me.
I am actually using a Text Field . I store the selected items in a Local Variable vSelectedItems, then when the user clicks on Submit, I write the vSelectedItems out to the Text field in my list.
So the Onchange property looks like UpdateContext({vSelectedItems:Concat(cboCountries.SelectedItems, Country_x0020_Name & ", "));
Loading the ComboBox is DefaultSelectedItems = RenameColumns(split(vSelectedItems, ", "),Result, "Value")
Regards
Nigel
Hi @v-xida-msft
I followed your suggestion and I got a three row blank collection. See attachment.
Regards
Nigel
Hi @NigelP,
Currently, I could not reproduce your issue on my side.
Please consider take a try to re-create a new app based on your SP list/other data source, then take a try with above solution I provided, check if the issue is solved.
If the issue still exists, please consider take a try to turn off/disable the "Improved app rendering (final validation)" option and "Explicit column selection" option within Advanced settings of App settings of your app, re-publish your app, check if the issue is solved.
Best regards,
Hi @v-xida-msft
I have taken a copy of the screen and created a brand new App.
The OnChange property is set to ClearCollect(Collection1,cboCountries_2.SelectedItems); as you suggested.
I do not get a single column "Value" in Collection1 but a list of fields which is the same as my SharePoint list "Countries".
The collection has 3 blank rows still. If I delete a country in the combobox, then I get two blank entries.
If I add a data table as you suggested with items set to Collection1. Then when I add a country, I get the name of the country in the data table. But I also get two blank rows. This corresponds with what is in the collection Collection1. the new country and two blank rows.
I have tried the old rendering option and the new Improved Rendering Option. Still the same.
The Explicit column Selection is switched off.
Should ComboBox "cbo_Countries_2" property DefaultSelectedItems contain the name of the countries selected in the Combo Box ? At the moment for existing selected countries I get a blank row.
Thanks
Nigel
Hi @v-xida-msft
I have finally got it working !!
The clue was that Collection1 had a list of fields non of which were "Value" !
So a spot of judisious renaming of columns sorted it.
1) ClearCollect(collCountries, Countries);
2) Items property of Combobox set to RenameColumns(collCountries,"Country_x0020_Name0","Value")
3) In data table set field to display to be "Value"
Then it all worked.
Thanks for all of your help.
Nigel
Hi @NigelP,
Have you solved your problem?
If you have solved your problem, please go ahead to click "Accept as Solution" to identify this issue has been solved for other users in this forum.
Best regards,
User | Count |
---|---|
253 | |
122 | |
106 | |
54 | |
48 |