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

List Box to HTML

Hello!

 

I am working with a List Box that allows for multiples selection.

Once the user selects the item(s) they want, I use the Mail function to send them.

I would like to add bullet points on each item so it looks better in the email.

 

Here's the code in the button that sends the email:

If(
    Or(
        IsBlank(CountryComboBox.Selected.Result),
        IsBlank(ListBox1.Selected)
    ),
    Notify(
        "Please select the desired Country and the area(s) you'd like assistance with",
        NotificationType.Error,
        3000
    ),
    Mail.SendEmailV3(
        "EMAIL ADRESS",
        CountryComboBox.Selected.Result & " Initiative Implementation Help Required",
        User().FullName & " from " & ComboBox2_1.Selected.Result & " requires information about the following topics(s):
    
" & Concat(
            ListBox1.SelectedItems.Value,
            Value,
            ",
"
        ) & "
" & "
    " & "That person's contact is " & User().Email & "
    " & "
    ",
        false,
        {cc: User().Email}
    );
    Notify(
        "An email with your request has been successfully sent to the relevant team.",
        NotificationType.Success,
        3000
    );
    Navigate(
        'Home Screen',
        ScreenTransition.Fade
    )
)

list box.PNGemailexample.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

For some reasons, I was still getting an error so I had to do some modifications. Here's what ended up working but thanks for the help! I would not have been able to make it work if it wasn't from the base you provided!

If(
    Or(
        IsBlank(ComboBox2_1.Selected.Result),
        IsBlank(ListBox1.Selected)
    ),
    Notify(
        "Please select the desired Country and the area(s) you'd like assistance with",
        NotificationType.Error,
        3000
    ),
    Mail.SendEmailV3(
        "EMAIL",
        ComboBox2_1.Selected.Result & " Initiative Implementation Help Required",
        User().FullName & " from " & ComboBox2_1.Selected.Result & " requires information about the following topics(s):<br>" & Concat(
            ListBox1.SelectedItems,
            "<li>" & Value
        ) & "<br><br>That person's contact is " & User().Email & "<br>" & "<br>" & "<div style=display:none;>",
        true,
        {cc: User().Email}
    );
    Notify(
        "An email with your request has been successfully sent to the relevant team.",
        NotificationType.Success,
        3000
    );
    Navigate(
        'Home Screen',
        ScreenTransition.Fade
    )
)

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@sam_sonepar 

Please consider changing your Formula to the following:

f(
    Or(
        IsBlank(CountryComboBox.Selected.Result),
        IsBlank(ListBox1.Selected)
    ),
    Notify(
        "Please select the desired Country and the area(s) you'd like assistance with",
        NotificationType.Error,
        3000
    ),
    Mail.SendEmailV3(
        "EMAIL ADRESS",
        CountryComboBox.Selected.Result & " Initiative Implementation Help Required",
        User().FullName & " from " & ComboBox2_1.Selected.Result & " requires information about the following topics(s):<br>
<ol>" & Concat(
            ListBox1.SelectedItems,
            "<li>" & Value "</li>",
        ) & 
"</ol><br><br>That person's contact is " & User().Email & "
<br>
    ",
        false,
        {cc: User().Email}
    );
    Notify(
        "An email with your request has been successfully sent to the relevant team.",
        NotificationType.Success,
        3000
    );
    Navigate(
        'Home Screen',
        ScreenTransition.Fade
    )
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Seems like it doesn't like part of that formula too much.

sam_sonepar_0-1615234930441.png

 

RandyHayes
Super User III
Super User III

@sam_sonepar 

Sorry, typo:

If(
    Or(
        IsBlank(CountryComboBox.Selected.Result),
        IsBlank(ListBox1.Selected)
    ),
    Notify(
        "Please select the desired Country and the area(s) you'd like assistance with",
        NotificationType.Error,
        3000
    ),
    Mail.SendEmailV3(
        "EMAIL ADRESS",
        CountryComboBox.Selected.Result & " Initiative Implementation Help Required",
        User().FullName & " from " & ComboBox2_1.Selected.Result & " requires information about the following topics(s):<br>
<ol>" & Concat(
            ListBox1.SelectedItems,
            "<li>" & Value & "</li>",
        ) & 
"</ol><br><br>That person's contact is " & User().Email & "
<br>
    ",
        false,
        {cc: User().Email}
    );
    Notify(
        "An email with your request has been successfully sent to the relevant team.",
        NotificationType.Success,
        3000
    );
    Navigate(
        'Home Screen',
        ScreenTransition.Fade
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

For some reasons, I was still getting an error so I had to do some modifications. Here's what ended up working but thanks for the help! I would not have been able to make it work if it wasn't from the base you provided!

If(
    Or(
        IsBlank(ComboBox2_1.Selected.Result),
        IsBlank(ListBox1.Selected)
    ),
    Notify(
        "Please select the desired Country and the area(s) you'd like assistance with",
        NotificationType.Error,
        3000
    ),
    Mail.SendEmailV3(
        "EMAIL",
        ComboBox2_1.Selected.Result & " Initiative Implementation Help Required",
        User().FullName & " from " & ComboBox2_1.Selected.Result & " requires information about the following topics(s):<br>" & Concat(
            ListBox1.SelectedItems,
            "<li>" & Value
        ) & "<br><br>That person's contact is " & User().Email & "<br>" & "<br>" & "<div style=display:none;>",
        true,
        {cc: User().Email}
    );
    Notify(
        "An email with your request has been successfully sent to the relevant team.",
        NotificationType.Success,
        3000
    );
    Navigate(
        'Home Screen',
        ScreenTransition.Fade
    )
)

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,999)