cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Englishweb
Level 8

How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hello

I have a label field which is populated by a combo box selection: Concat(S1Combo.SelectedItems, NAME & " " & FIRSTNAME, ",")

How do I set the label default properties to ThisItem.S1Student as well?

At the moment all the Gallery records have the same name! I need to show an individual name (selected from the combobox) for each record in the Gallery.

Thanks in advance for any help

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hi @Englishweb ,

Could you please share a bit more about your scenario?

Do you want to update the Label to the latest saved ComboBox selection value when you patch value to your data source?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Save" button to following:

Patch(...);
Set(ShowSavedValue, true)

Set the OnChange property of the ComboBox to following:

Set(ShowSavedValue, false)

Set the Text property of the Label to following:

If(
   ShowSavedValue,
   ThisItem.Student1,
   Concat(S1Combo.SelectedItems, NAME & " " & FIRSTNAME, ",")             /* <-- Display the selected ComboBox values when you change the ComboBox value */
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

13 REPLIES 13
Super User
Super User

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

@Englishweb 

Try this code.  If does not produce the desired result please give examples of what you would like to see.

 

Concat(S1Combo.SelectedItems, NAME & " " & FIRSTNAME, ",")&ThisItem.S1Student

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

Englishweb
Level 8

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hello @mdevaney 

Thanks for your reply, The Gallery records are now individual Smiley Happy however, your solution collects all the combo box selections to the text box. I'm trying to update the text box with the last saved combo selection only. (see attached image)

(I Have a ClearCollect button and Patch to datasource)

Super User
Super User

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

@Englishweb 
If I understand correctly, you want to display the last saved item from the combobox.  To do this you need to directly reference the field from your datasource (I assume it is called surname) instead of referencing the ComboBox.

 

ThisItem.Surname

 

Englishweb
Level 8

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hello @mdevaney 

& ThisItem.Student1

Not sure if I understand you correctly

The text box : Concat(S1ComboConcat.SelectedItems,PRENOM & " " & NOM,",")& ThisItem.Student1

Student1 is the column header in the Excel datasource that the data is being saved to.

The Combo box has a different data table: ALLSTUDENTS. Its column headers are "PRENOM" "NOM"

Sorry if I'm missing something obvious!

Super User
Super User

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

I think we might be having a tough time communicating here, lol, but I know we will try our best!

If you you want the last saved StudentName only from your main table just use this and no other code. This will pull all students saved within the field (there could be multiple).

ThisItem.Student1

If there are multiple names saved and you only want the last one do this instead.

Last(ThisItem.Student1)
Englishweb
Level 8

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hello @mdevaney 

Many thanks for your patience, I'm sorry if I haven't explained myself clearly.

On its own Concat works great BUT each Gallery record is the same.

ThisItem.Student1 works on 'simple' text box defaults where there is nothing else in the default property. 

The problem is that I'm  using Concat to pull 2 fields (NOM / PRENOM) from the combo box AND use ThisItem for the same text box.

Perhaps there is a work around for a solution, Is there  another connector instead of '&' ?

Super User
Super User

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

@Englishweb
I am totally lost...

Maybe you can give a screenshot of what the bad result looks like and then make a mock up of the good result
Englishweb
Level 8

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hope this helps - I'm very grateful for your time and continued patience!thisItem.PNG

 

Community Support Team
Community Support Team

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hi @Englishweb ,

Could you please share a bit more about your scenario?

Do you want to update the Label to the latest saved ComboBox selection value when you patch value to your data source?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Save" button to following:

Patch(...);
Set(ShowSavedValue, true)

Set the OnChange property of the ComboBox to following:

Set(ShowSavedValue, false)

Set the Text property of the Label to following:

If(
   ShowSavedValue,
   ThisItem.Student1,
   Concat(S1Combo.SelectedItems, NAME & " " & FIRSTNAME, ",")             /* <-- Display the selected ComboBox values when you change the ComboBox value */
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,498)