Hi All
I have a custom datacard with a 20+ checkboxes. I have a ClearCollect() for each checkboxes OnCheck and UnCheck property. to bring those 20+ items into a collection.
What i now want to do, is in a dropdown (or textbox) to return the values of the selected checkbox items.
The DataCard Update property is : CollectionName
Dropdown
Items : CollectionName
DefaultSelectedItems: CollectionName
SelectMultiple: true
do i need to change the items for the Dropdown? if so, what should it be to update and show results as i check and uncheck the boxes?
oh. thanks!
Hi @KristyH ,
Do you want the results to be populated into the Drop Down by default? If you use Drop Down, this has a limitation: you can't populate multiple options, so I suggest you change Drop Down to a Combo Box and set it up like this:
Items:StartegySelection
DefaultSelectedItems:Filter(StartegySelection,value=true)
Best regards,
Rimmon Li
Thanks for that, i have double checked the code. i believe the problem was i had Value and not value in the last filter.
the drop down now populates with the multiple selections., if i click the drop down. however, it does not show the multiple selections upon closing the dropdown. i don't need it to be a dropdown box, i just want to see in Option1, Option2, Option 3 format in a text when i select or deselect the checkboxes
Hi @KristyH ,
Please try this:
Steps in my test.
1)Check Box and DropDown:
2)Code on the OnSelect of each Check Box:
ClearCollect(yy,{check:Checkbox1.Text,status:Checkbox1.Value},{check:Checkbox2.Text,status:Checkbox2.Value},{check:Checkbox3.Text,status:Checkbox3.Value}
);
ClearCollect(yy,Filter(yy,status=true)
)
Since our settings have different names, I've changed the name to yours.
ClearCollect(StartegySelection,
{checkbox:Chk_Strategy1.Text,value:Chk_Strategy1.Value},{checkbox:Chk_Strategy2.Text,value:Chk_Strategy2.Value},{checkbox:Chk_Strategy3.Text,value:Chk_Strategy3.Value},
{checkbox:Chk_Strategy4.Text,value:Chk_Strategy4.Value},{checkbox:Chk_Strategy5.Text,value:Chk_Strategy5.Value},{checkbox:Chk_Strategy6.Text,value:Chk_Strategy6.Value},{checkbox:Chk_Strategy7.Text,value:Chk_Strategy7.Value},{checkbox:Chk_Strategy8.Text,value:Chk_Strategy8.Value},{checkbox:Chk_Strategy9.Text,value:Chk_Strategy9.Value},{checkbox:Chk_Strategy10.Text,value:Chk_Strategy10.Value},{checkbox:Chk_Strategy11.Text,value:Chk_Strategy11.Value},{checkbox:Chk_Strategy12.Text,value:Chk_Strategy12.Value},
{checkbox:Chk_Strategy13.Text,value:Chk_Strategy13.Value},{checkbox:Chk_Strategy14.Text,value:Chk_Strategy14.Value},{checkbox:Chk_Strategy15.Text,value:Chk_Strategy15.Value},
{checkbox:Chk_Strategy16.Text,value:Chk_Strategy16.Value},{checkbox:Chk_Strategy17.Text,value:Chk_Strategy17.Value},{checkbox:Chk_Strategy18.Text,value:Chk_Strategy18.Value},
{checkbox:Chk_Strategy19.Text,value:Chk_Strategy19.Value},{checkbox:Chk_Strategy20.Text,value:Chk_Strategy20.Value}
);
ClearCollect(StartegySelection,Filter(StartegySelection,value=true)
)
3)The Items of my Dropdown:
The Items of your Dropdown:
StartegySelection
Please check if your above steps are correct.
The result of my test:
When I select the Chech Box1:
When I select the Chech Box1 and Check Box2:
If your setup is like mine, I recommend you first try setting up three checkboxes, run them and check the data in the collection.
Best regards,
Rimmon Li
i have removed the OnCheck and UnCheck coding. but i still have the same issue.
is there anythign else?
Hi @KristyH ,
Of course, you need to clear your original OnCheck and OnUncheck settings, otherwise you will be performing different operations on the collection with the same name.
Best regards,
Rimmon Li
here is a screenshot in App Preview Mode. I have selected the dropdown and nothing is showing:
do you mean to remove the code from OnCheck and OnUncheck? and only retain the OnSelect Code?
Hi @KristyH ,
Do you mean that when you run the app, after selecting the checkbox, the value in the dropdown list is not updated? In my tests everything works fine, I suggest you use the code I provided earlier and clear your original settings.
If there are errors, I hope you can provide some screenshots of the errors.
Best regards,
Rimmon Li
actually.. it updated the dropdown with what was already ticked. but it didn't update in Play mode, when i tested ticked and unticking the checkboxes
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48