Update Sharepoint from Combobox
-
Update Sharepoint from Combobox
Posted by DSC Communities on November 14, 2020 at 12:42 am-
Mohan Srinivasamurthy
MemberNovember 14, 2020 at 12:42 AM
Hi All,ĀI need help in updating SharePoint list from multi select combo box from canvas app.Ā
I have SharePoint list 1 – with multi select “email address” and this act as input for combobox1 in my canvas app.Ā
I use Patch statement to update outputs from canvas app to SharePoint list 2.
I want users to multi select email address in canva app which will be patched in Sharepoint list 2 but unable to do it and getting an error that states mismatch data type.Ā
I am able to achieve this using dropdown box but not able to achieve this using combo box.Ā
Can you please suggest what is the correct syntax?
I use “EMail address: combobox1.selecteditems.text.Ā
Thanks,
S.Mohan——————————
Mohan Srinivasamurthy
senior manager
—————————— -
Warren Belz
MemberNovember 15, 2020 at 3:12 PM
Hi ,
Assuming the Items of the Combo Box are something likeSPList1.'Email Address'?
and you are writing back to a (single line of) Text field, your Update on the Data Card would be
Concat(ComboBox1.SelectedItems,'EMail Address' & ",")
?
——————————
Warren Belz
Queensland Australia
——————————
——————————————- -
Mohan Srinivasamurthy
MemberNovember 16, 2020 at 4:26 AM
HiThanks for your suggestion. I am still getting an error.Ā
Just to clarify, items for combo box are coming from SharePoint list named “Team” and field name is “Email” which is single line text.
Through Patch statement, i am updating field “Email to be sent to” field which is also single line text SharePoint list 2.Ā
I get an error that states “The type of this argument “Emailtobesentto” does not match the expected type “Table”. Found type “Text”.
If i change “email to be send to” as “Choices” with multiple selection allowed type then error is ” “The type of this argument “Emailtobesentto” does not match the expected type “Text”. Found type “Table”.
Please advise.Ā
Thanks,
Mohan S——————————
Mohan Srinivasamurthy
senior manager
——————————
——————————————- -
Warren Belz
MemberNovember 16, 2020 at 6:47 AM
Hi ,
All of this depends on two things:- The Items of the Combo Box
- The type of field you are writing back to
If you are writing from a multi-choice field, the syntax I gave you will separate the values with a comma. The Items will determine how you refer to the ?content – it is probably
Concat(ComboBox1.SelectedItems, Email & ",")?
This would write a line of text back to your Text field. Your error however suggests one of the fields is a complex field type (table).
Can you please confirm the Items of the Combo Box——————————
Warren Belz
Queensland Australia
——————————
——————————————- -
Mohan Srinivasamurthy
MemberNovember 16, 2020 at 9:55 AM
Hi ,Combo box – Connected to data source “Team” which is SharePoint list. This list has name and email address. I use “Email” header from this list which is of data type “single line of text”. This has list of email addresses to be selected.Ā Ā
?
Next, i have added below in my Patch statement –Ā “OnSelect” button as per your suggestion.Ā
‘Email to be sent to’ = This is the field to which i want to save the selected “Email” address from the above combo box. This is in another SharePoint list. I tried changing this data type asĀ Multiple lines of text as well as Choices with allow multiple selection. But, still getting an error.
Thanks,
Mohan S——————————
Mohan Srinivasamurthy
senior manager
——————————
——————————————- -
Warren Belz
MemberNovember 16, 2020 at 4:33 PM
Hi ,
Where is your Patch code applied? Also you still have not told me the Items of the combo box. The “error” you have is a Delegation warning, not a code error.?——————————
Warren Belz
Queensland Australia
——————————
——————————————- -
Mohan Srinivasamurthy
MemberNovember 17, 2020 at 7:48 AM
Hi ,Sorry, i am not clear with “items of the combo box”. I just started learning and ?could not understand this. Can you please let me know what details should i share?
I have inserted a button and have written patch code on “OnSelect”.
Thanks,
Mohan S——————————
Mohan Srinivasamurthy
senior manager
——————————
——————————————- -
Warren Belz
MemberNovember 17, 2020 at 3:54 PM
,
Highlight the combo box, look in the drop-down at top left and select Items. The details will be in the box to the right of this. ?——————————
Warren Belz
Queensland Australia
——————————
——————————————- -
Mohan Srinivasamurthy
MemberNovember 18, 2020 at 1:40 AM
Hi ,Thanks. Please see below.Ā
Combo box – Connected to data source “Team” which is SharePoint list. This list has name and email address. I use “Email” header from this list which is of data type “single line of text”. This has list of email addresses to be selected.
?
——————————
Mohan Srinivasamurthy
senior manager
——————————
——————————————- -
Warren Belz
MemberNovember 18, 2020 at 2:27 AM
What field in the list “team” are you displaying in the combo box?——————————
Warren Belz
Queensland Australia
——————————
——————————————- -
Mohan Srinivasamurthy
MemberNovember 18, 2020 at 3:13 AM
Hi ,I have fixed it and i am able to select emailids from comboĀ box and send mails as per your above suggestion. Thank you so much for yourĀ help.
Note – “Team” SharePoint list has name and email address. I use “Email” field from this list to show in combo box.Ā
on a different note, i kindly request you to suggest if there is any book or online materials that i can use to learn concepts better. Thanks again.Ā
?
Thanks,
S.Mohan——————————
Mohan Srinivasamurthy
senior manager
——————————
——————————————- -
Dyhia TOUAHRI
MemberJuly 7, 2022 at 11:45 AM
Hi ,Have you found the solution to your problem?
Today I’m facing exactly the same situation and I’m struggling to find a solution.Thank you in advance,
Dyhia
??——————————
Dyhia TOUAHRI
——————————
——————————————- -
Dyhia TOUAHRI
MemberJuly 20, 2022 at 8:59 AM
Hi,I tried this and it worked.
I’m sharing it here in case anyone else has the same problem.I’m not very familiar with Powerapps, I’ve just started, so I don’t know if it’s a very good solution, but it works for me.
The context :
I have a collection (Repository) that has a field (Carrier) with type table and to read and update this table I used a comboBox.//I have retrieved the data from my combobox and stored it in a variable named comboBoxData
Set(comboBoxData,Split(Concat(ComboBox1.SelectedItems, Carrier;”,”);”,”));
//I changed the column name of my table and stored the result in a new variable
Set(comboBoxDataBis, RenameColumns(comboBoxData,”Result”,”Value”));
//I have patched my new value
Patch(Repository,RepositoryGallery.Selected,{Carrier: comboBoxDataBis});
I hope this will help someone .
Good luck,
Dyhia——————————
Dyhia TOUAHRI
——————————
——————————————-
DSC Communities replied 4 years, 9 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘Update Sharepoint from Combobox’ is closed to new replies.