Hi all,
I have a problem in saving all values from a collection. I created a set of input fields in a collection and i need to save all the data to a database.
Set of input fields in collection
I was able to patch the data to a database but when i checked the table, only the last value was saved and was replicated thrice.
Here's my formula.
Solved! Go to Solution.
Hi @escimorales ,
Based on the formula you provided, I could not find any syntax error with it.
I have made a test on my side, and don't have the issue that you mentioned. Please consider modify your formula as below:
ForAll( TEST_agendaGallery_1.AllItems, Patch( '[dbo].[Agenda]', Defaults('[dbo].[Agenda]'), { MeetingId: Last('[dbo].[Meeting]_1').MeetingId, Description: agendaTxtInput_1.Text, TimeAllocation: Time(Value(AgendaAllocHours_1.Selected.Value), Value(AgendaAllocMinutes_1.Selected.Value), 0), Responsible: Concat(MeetingAgendaAssignee_1.SelectedItems, EmployeeName & "; ") } ) )
Also please consider take a try with the following formula:
ClearCollect(GalleryCollection, TEST_agendaGallery_1.AllItems);
ForAll( GalleryCollection, Patch( '[dbo].[Agenda]', Defaults('[dbo].[Agenda]'), { MeetingId: Last('[dbo].[Meeting]_1').MeetingId, Description: agendaTxtInput_1.Text, TimeAllocation: Time(Value(AgendaAllocHours_1.Selected.Value), Value(AgendaAllocMinutes_1.Selected.Value), 0), Responsible: Concat(MeetingAgendaAssignee_1.SelectedItems, EmployeeName & "; ") } ) )
Please take a try with above solution, check if the issue is solved.
If the issue still exists, please consider re-create a new app based on your data source, then try above formula again, check if the issue is fixed.
Best regards,
Hi Escimorales,
I would suggest you to first collect values in collection and check if they are showing as you required.
I have tried following and its working as expected. (I have placed a multiselect combobox and label controls in gallery)
//Loop through all items in gallery and collect in SelectedGalleryValues collection. This is useful if you have only one selected item in combobox.
ForAll(Gallery1.AllItems,Collect(SelectedGalleryValues,{combovalue:ComboBox2.SelectedItems.Value1,namevalue:FullName.Text}));
//This is useful if you need multiselected values in combobox.
ForAll(Gallery1.AllItems,Collect(SelectedGalleryValues2,{combovalue:Concat(ComboBox2.SelectedItems,Value1 & ","),namevalue:FullName.Text}));
That's how my gallery and collection looks like.
If this answers your question plesae mark it as verified.
Regards,
Pavan Kumar Garlapati
Hi @escimorales ,
Based on the formula you provided, I could not find any syntax error with it.
I have made a test on my side, and don't have the issue that you mentioned. Please consider modify your formula as below:
ForAll( TEST_agendaGallery_1.AllItems, Patch( '[dbo].[Agenda]', Defaults('[dbo].[Agenda]'), { MeetingId: Last('[dbo].[Meeting]_1').MeetingId, Description: agendaTxtInput_1.Text, TimeAllocation: Time(Value(AgendaAllocHours_1.Selected.Value), Value(AgendaAllocMinutes_1.Selected.Value), 0), Responsible: Concat(MeetingAgendaAssignee_1.SelectedItems, EmployeeName & "; ") } ) )
Also please consider take a try with the following formula:
ClearCollect(GalleryCollection, TEST_agendaGallery_1.AllItems);
ForAll( GalleryCollection, Patch( '[dbo].[Agenda]', Defaults('[dbo].[Agenda]'), { MeetingId: Last('[dbo].[Meeting]_1').MeetingId, Description: agendaTxtInput_1.Text, TimeAllocation: Time(Value(AgendaAllocHours_1.Selected.Value), Value(AgendaAllocMinutes_1.Selected.Value), 0), Responsible: Concat(MeetingAgendaAssignee_1.SelectedItems, EmployeeName & "; ") } ) )
Please take a try with above solution, check if the issue is solved.
If the issue still exists, please consider re-create a new app based on your data source, then try above formula again, check if the issue is fixed.
Best regards,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
200 | |
99 | |
59 | |
58 | |
53 |
User | Count |
---|---|
257 | |
161 | |
88 | |
79 | |
69 |