cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

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
Highlighted
Community Support
Community Support

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
Highlighted
Super User III
Super User III

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."

Highlighted
Post Patron
Post Patron

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)

Highlighted
Super User III
Super User III

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

 

Highlighted
Post Patron
Post Patron

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!

Highlighted
Super User III
Super User III

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)
Highlighted
Post Patron
Post Patron

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 '&' ?

Highlighted
Super User III
Super User III

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
Highlighted
Post Patron
Post Patron

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

 

Highlighted
Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,976)