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

Set ComboBox DefaultSelectedItems

Hi Team,

 Need urgent help on setting default selected item of a combobox .

 I am storing the combobox selected item in to a text field of sharepoint with "," separated .

 

Textvalue = "Item1,Item2,Item3"

 

So when next time user will navigate to the form , he should be able to see Item1, Item2,Item3 selected .

 

and it should not allow user to select Item1 or Item2 or Item3 again .

 

Please suggest.

 

Thanks

gautmish

1 ACCEPTED SOLUTION

Accepted Solutions
TimRohr
Level 10

Re: Set ComboBox DefaultSelectedItems

I think you're going to have to use Split() to parse that string into a 1d table.

 

Once you have that, look at this thread for how you go about disallowing those items:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/Primary-Secondary-and-Tertiary-Drop-Dow...

View solution in original post

2 REPLIES 2
TimRohr
Level 10

Re: Set ComboBox DefaultSelectedItems

I think you're going to have to use Split() to parse that string into a 1d table.

 

Once you have that, look at this thread for how you go about disallowing those items:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/Primary-Secondary-and-Tertiary-Drop-Dow...

View solution in original post

MihirY
Level 8

Re: Set ComboBox DefaultSelectedItems

I got the table by using split function. I have done as below

UpdateContext({defaultSelectedItems: (Split(LookUp(MultiValueTransaction,ID=glbSelValue.ID,TransRelationValues),",").Result)});
Clear(colDefaultItems);
ForAll(defaultSelectedItems,Collect(colDefaultItems,Result))

I am getting the table then converting to collection. I have applied this to combo box which i am seeing the results. but the problem is those results were not selected in the combobox as shown in below pictures. 

PA_Defaultitems.PNGPA_Defaultitems2.PNG

Same value has been selecting twice but when I deselect the same value previous value (from code) is still there. 

 

How to fix this?

 

 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,981)