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

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (73,299)