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