web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

CC for new Form doesn't work correctly

(0) ShareShare
ReportReport
Posted on by 22

Hi, 

 

I've got an issue with power apps form (based on SharePoint list). 

 

When new form is created and all necessary data are filled CC is not applied from the new form, but is collecting the data from last one.

Everything works when the email is sent from edit form.

 

Here is how the formula looks like (New Form):

Email is sent when form is correctly submitted, so "on success" we've got:

Office365Outlook.SendEmailV2(Last('SPX NCR Data Base').'Odpowiedzialny/Responsible'.Email,
"Internal NCR no: " & Last('SPX NCR Data Base').'NCR ID' & " is Delegated to You",
"<br><b> NCR Created By: </b>" & Last('SPX NCR Data Base').'Created By'.DisplayName &
"<br><b>Grupa Produktowa/Product Line:</b> " & Last('SPX NCR Data Base').'Grupa Produktów/Product line'.Value &
"<br><b> Sales Order:</b> " & Last('SPX NCR Data Base').'Zamówienie / Sales Order' &
"<br><b> Production Order:</b> " & Last('SPX NCR Data Base').'Zlecenie Produkcyjne / Production Order' &
"<br><b>Indeks/Part No:</b> " & Last('SPX NCR Data Base').'Indeks / Part no.' &
"<br><b>Opis Indeksu/Part description:</b>" & txtMaterDescription.Text &
"<br><b>Ilość/Quantity:</b> " & Last('SPX NCR Data Base').'Ilość / Quantity' &
"<br><b>Opis niezgodności/Problem description:</b> " & Last('SPX NCR Data Base').'Opis Problemu/ Problem Description' &
"<br><b>Link do NCR'a/Link to NCR:</b> " & Last('SPX NCR Data Base').'Link to item' &
"<br><b> Komentarze od ostatnio modyfikujących/Comments from last modifiers:<br></b> " & Last('SPX NCR Data Base').'Podjęte działania/Action taken',
{Cc:Last('SPX NCR Data Base').'CC List of person'});
Back(ScreenTransition.None)

 

CC list of person is as below:

Concatenate(Concat(DataCardValue25_2.SelectedItems,Email&"; "), DataCardValue32_2.Selected.Email)

 

Edit form formula (it's on select - button):

SubmitForm(FormEdit);
Office365Outlook.SendEmailV2(
responsible.Selected.Email,
"Internal NCR no: " & DataCardValue21.Text & " has been modiefied by " & txtModifiedBy.Selected.DisplayName,
"<br><b> NCR Created By: </b>" & txtCreatedBy.Selected.DisplayName &
"<br><b>Grupa Produktowa/Product Line:</b> " & DataCardValue1.Selected.Value &
"<br><b> Sales Order:</b> " & DataCardValue6.Text &
"<br><b> Production Order:</b> " & DataCardValue7.Text &
"<br><b>Indeks/Part No:</b> " & Index.Text &
"<br><b>Opis Indeksu/Part description:</b>" & txtMaterDescription.Text &
"<br><b>Ilość/Quantity:</b> " & QTy.Text &
"<br><b>Opis niezgodności/Problem description:</b> " & ProblemDes.Text &
"<br><b>Link do NCR'a/Link to NCR:</b> " & DataCardValue26.Text &
"<br><b> Komentarze od ostatnio modyfikujÄ…cych/Comments from last modifiers:<br></b> " & AppendHTMLText.HtmlText,
{Cc:DataCardValue3.Text});
Refresh(FormView.LastSubmit);
Back(ScreenTransition.None)

 

DatacardValue3 formula as below:

Concatenate(Concat(DataCardValue25.SelectedItems,Email&"; "),txtCreatedBy.Selected.Email,"; ",txtModifiedBy.Selected.Email,"; ",DataCardValue32.Selected.Email)

 

As I mentioned everything else in new form works correctly, there is no issue with sender, responsible person etc.

Please keep in mind that CC is multiple selection dropdown and the plan is collect the data from several fields and put them in copy of the mail, as it is presented in datacardvalue3. Why it works for edit form and why it cannot be applied to new form (for example by function "Last()". Screen from the form is attached.

 

If something is unclear please put your comment, so I will describe it more precisely.

 

Thank you for help

Tomasz 

I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    151,903 Most Valuable Professional on at
    Re: CC for new Form doesn't work correctly

    Hi @tjowek ,

    The only piece of code here is 

    {Cc:Last('SPX NCR Data Base').'CC List of person'}

    The problem is that the last item at that point is not the one you have just posted as the list has not been refreshed.

    You need

    {
     Cc:
     YourNewFormName.LastSubmit.'CC List of person'
    }

     

    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.

  • tjowek Profile Picture
    22 on at
    Re: CC for new Form doesn't work correctly

    Hi @WarrenBelz,

     

    Thank you for prompt answer. 

     

    I think this solve the problem somehow, but now I've got new one (below & attached):

     

    When I put a person as a receiver (responsible person) without anyone in cc, it works correctly. However, if the same person as previously is in the CC of the e-mail (could be even doubled xyz as receiver and in the CC), button doesn't work and no-one receive the email - error as below

    tjowek_0-1598431941024.png

  • WarrenBelz Profile Picture
    151,903 Most Valuable Professional on at
    Re: CC for new Form doesn't work correctly

    Hi @tjowek ,

    It appears you are sending an invalid email address. It is a bit hard for me to comment with the limited information you have provided. The best way to test is to write the relevant values to a label of the screen and see if they are the correct address.

     

    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.

  • tjowek Profile Picture
    22 on at
    Re: CC for new Form doesn't work correctly

    Hi @WarrenBelz,

     

    I've got the same (similar formula) in edit & new form. Person is chosen from SharePoint list, so it automatically type e-mail address.  For edit form it works, but for new form error appears as I attached. 

     

    Data is linked to the formula 

    tjowek_0-1598433641944.png

     

    I even put the correct address by "hand" to the label, but still I've got the same error. Address listed in the error is correct. 

     

    thank you

    Tomasz 

     

  • WarrenBelz Profile Picture
    151,903 Most Valuable Professional on at
    Re: CC for new Form doesn't work correctly

    @tjowek ,

    Does your new form submit an email address. If you put this on a label

    YourNewFormName.LastSubmit.'CC List of person'

    and submitted a new form, do you get the value you are expecting?

  • tjowek Profile Picture
    22 on at
    Re: CC for new Form doesn't work correctly

    Hi @WarrenBelz 

     

    Please find a screen below:

    tjowek_0-1598440393646.png

     

    IT's:

    <div class="ExternalClass547476DD22014B97BF6B716EF528DCBA"> Email addresses which are correct ,</div>

  • WarrenBelz Profile Picture
    151,903 Most Valuable Professional on at
    Re: CC for new Form doesn't work correctly

    @tjowek ,

    Just a label will do - are you saying that you get the correct address on the code I gave you after submitting a new form?

  • Verified answer
    tjowek Profile Picture
    22 on at
    Re: CC for new Form doesn't work correctly

    @WarrenBelz 

     

    Got the solution. Problem was related to the settings of SharePoint list. It was specified as an Enhanced rich text, while we have changed it to plain text it solves the issue. 

    tjowek_0-1598444616637.png

     

    Many thanks for help.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 384 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 246

Last 30 days Overall leaderboard