cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Combobox default values from csv

Hi All,

 

I have a table of questions which a user can add to, and I want them to also be able to edit them. the value of 'Stage' is stored in the table as a csv, and when on the edit page, I want to populate my combo box with the previous items they selected. I was trying to use the split function but it is not seing the item as text, it sees it as a table. Any ideas how I can split the values in the table to use them as the default values when updating previous selections?

 

TaError.png

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I got it!!

 

I need to add the detail to defaultselecteditems (not default), and use this code:

 

If(";" in DataTable3.Selected.Stages,ForAll(Split(DataTable3.Selected.Stages,";"), Result),[DataTable3.Selected.Stages])

 

That only took all day! Thanks for your response though Russel 🙂

View solution in original post

6 REPLIES 6
RusselThomas
Microsoft
Microsoft

Hi @Anonymous ,


The Default: property of the DropDown control is looking for a single record from the DropDown items to set as the default entry.  You should probably be looking to change the Items: property to create the dropdown list items before choosing the default entry.

Also, your list of entries is comma separated, but your split command is looking for a semi-colon.

Try this;
Set the Items: property of the DropDown to 

Split(ThisItem.Stages, ",")

Then, if you actually want a default entry set, set the Default: property to either the value of a specific entry - i.e. "Stage 1", or the value of the data field containing the current stage, or leave it out to be blank on start.

Hope this helps,

RT

Anonymous
Not applicable

Thanks Russel,

 

If I set the split as the item property, it splits correctly but doesn't show all the values I need, just the ones the user selected the first time. I want them to be able to update from the full list.

 

Cheers

Kathryn

Hi @Anonymous ,

 

Ok, perhaps a few clarifying questions first:

 

  • Why the combobox - can users select more than one stage at a time, and do you then want to filter something as a result by multiple stages?
  • What is this selection doing?  i.e. what actions are taken as a result of the user making their selection?
  • When you say it just shows what the user selected the first time - what do you mean?  It should show what the values are for that particular row's Stages field - is that not what you want?

One last thought - Comboboxes have a sticky memory, so previously selected Items would need to be cleared between selections - you can use the Reset() function to do this.

Kind regards,

RT

Anonymous
Not applicable

Thanks, I've added my answers:

 

  • Why the combobox - can users select more than one stage at a time, and do you then want to filter something as a result by multiple stages? Yes, they can select multiple stages, and this is the edit page so they can go back and update those selections if required.
  • What is this selection doing?  i.e. what actions are taken as a result of the user making their selection? Once the user has made the changes, I will just write the updates back to the table.
  • When you say it just shows what the user selected the first time - what do you mean?  It should show what the values are for that particular row's Stages field - is that not what you want? Yes, but not as it it stored in the table. I need to split it first so they are selecting from the list again. I don't want it to show "stage 1, stage 3" as the selection.
Anonymous
Not applicable

I got it!!

 

I need to add the detail to defaultselecteditems (not default), and use this code:

 

If(";" in DataTable3.Selected.Stages,ForAll(Split(DataTable3.Selected.Stages,";"), Result),[DataTable3.Selected.Stages])

 

That only took all day! Thanks for your response though Russel 🙂

Awesome, well done!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,945)