cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sam44
Helper III
Helper III

Lookup another SharePoint list, using ComboBox (SharePoint custom form)

I'm creating canvas app as build-in SharePoint form and it is communication history list.

With this list, I have 3 columns as "Title(system)", "Body(multi line text)", "EmailAddress (single line of text)".

As Email, I wanted use SharePoint "User" data type but requirement only allowed me to create another SharePoint custom list to manage only disignated users and groups with email address.

Address list which was created as SharePoint custom list has two columns as "Title(system)", "Email(single line of text)".

 

My problem is,

At Community history list PowerApps form, EmailAddress column, we want to use Combobox to choose multiple EmailAddress from Address list and using Outlook connector, send Title and  Body to all destinations which is selected on ComboBox.

 

How I can archive this?

Appreciate any help on this.

10 REPLIES 10
WarrenBelz
Super User
Super User

Hi @Sam44 ,

Assuming that the ComboBox is from the list Email address and the returned value is ComboBoxName.Selected.EmailAddress

The To: line in Office365Outlook.SendEmail would be

Concat(
   ComboBoxName.SelectedItems,
   EmailAddress,
   "; "
)

 This would put a semi-colon and a space between the email addresses, which is the correct format to send multiple emails.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

eka24
Super User
Super User

These videos on combobox and email from shane Young will help
https://youtu.be/pjs0ZsnJZXo
https://youtu.be/bF7WkqtxKB0
v-siky-msft
Community Support
Community Support

Hi @Sam44 ,

 

To work around your problem, please try the following steps:

1. Delete the TextInput box in 'EmailAddress ' Card and Add a Combobox in it.

2. Set Items property of Combobox: Address.Email

3. Modify Update property of DataCard: ComboBoxName.Selected.Email

4. Modify Y of ErrorMessage: ComboBoxName.Y + ComboBoxName.Height

5. Add Office365Outlook connection, add a SendEmail button, set OnSelect property:

 

Office365Outlook.SendEmailV2(<ComboBoName>.Selected.Email, <TitleDataCardValue>.Text, <BodyDataCardValue>.Text) //repalce by the real control name.

 

Then once you click the SendEmail button, it will send an email to the selected Email with Title and Body shown in the form.

Hope this helps.

Sik

 

HI @Sam44 ,

Some options here, please tag the process that best suits your needs to continue the thread with.

Sam44
Helper III
Helper III

Thanks @WarrenBelz , @v-siky-msft , @eka24  for your practical help!!

Having a Email address with ";" works fine with both of way.

 

@v-siky-msft 

When I try to save data with SharePoint's build-in Save button, Only one selected item was not written though I choose multiple items on ComboBox. (Reason because I switched Textinput to ComboBox, but data type of column is "Single-line of Text"?)

 

Another problem is When I open SharePoint item with view mode, Data doesn't appear on ComboBox and says combobox DefaltSelectedItems propaty needs "Table"....

 

Is there any way to solve this?

v-siky-msft
Community Support
Community Support

Hi @Sam44 ,

 

OK.  

To the first question:
Have you modified the Update property of DataCard to ComboBoxName.Selected.Email?

To the second question:

Please modify the DefaultSelectedItems property of combobox: LookUp(Address.Email, Email = ThisItem.EmailAddress)

 

Sik

@v-siky-msft 

Yes, I've checked Update property of datacard as "Combobox-name.Selected.Email"

But Only last items I chose was written back to SharePoint.(I've checked at SharePoint list.)

 

As for the DefaultSelectedItems property, your suggestion worked well!, Thank you!!
I've also tried this.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Combo-box-in-edit-forms/td-p/163391

This also worked but doesn't understand the meaning of below formula.

If(
    EditForm1.Mode = FormMode.New,
    {
       '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Value: "-" 
    },
    {
       '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Value:Parent.Default
    }
)

 

v-siky-msft
Community Support
Community Support

Hi @Sam44 ,

 

That code adds a condition to check If the Form is in NEW mode, No default selection in combobox.

As for the record definition, I haven't used, I am not sure this is suitable for all cases.

 

The formula logic I post is the safest, since the DefaultSelectedItems should come from Items of combobox, so I use LookUp function to get the record form Combobox Item.

Hope this helps.

Sik

 

Got it! Thanks @v-siky-msft 

Any idea for "Only last selected items on combobox was written to SharePoint?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,276)