cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EliasMerabet
Advocate II
Advocate II

Send an email and DataCardValues

Hello Team,

 

Trying to send an email, the content of it is something like this:

Office365Outlook.SendEmail(Dropdown2.Selected.Usuario, "Tarea Creada: " & DataCardValue58.Text & ". Usuario: " &DataCardValue65.Text & ". Número de ID: " & Text(_ID), _Contenido);

Where _Contenido es:

Set(_Contenido, Concatenate("FYI ==> Hola ", Dropdown2.Selected.Nombre, " /n /n El usuario ", _Usuario, "ha creado la tarea número ", Text(_ID), ", con título ", DataCardValue58.Text, " y cuya descripción es <", DataCardValue59.Text, ">. Las horas programas serán: ", DataCardValue60.Text));

 

As you can see, I used different approach: concatenate, & y Set a variable. Nothing work. Always the email sent shows the datacardvalues in blank.

Wha I am doing wrong?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

@EliasMerabet 

 

Try

 

OnSelect (Button):

SubmitForm(Form7)

 

OnSuccess:

Office365Outlook.SendEmailV2(Dropdown2.Selected.Usuario, "Tarea Creada: " & Form7.LastSubmit.Title & ". Usuario: " & _MyUser & ". Número de ID: " & Form7.LastSubmit.ID, Concatenate("**FYI** <br/>Hola ", Dropdown2.Selected.Nombre, " <br/><br/> El usuario ", _MyUser, " ha creado la tarea número ", Text(Form7.LastSubmit.ID), " con fecha de creación: ", Text(Now(), "dd/mm/yyyy"),", con título ", Form7.LastSubmit.Title, " y cuya descripción es <br/><br/>==========<br/> ", Form7.LastSubmit.Descripcion, " <br/>==========.<br/><br/><b>Las horas programadas de duración de la tarea serán: ", Text(Form7.LastSubmit.'Horas Programadas'), "horas<b/>"));
ResetForm(Form7)

 

See if above works @EliasMerabet  

View solution in original post

17 REPLIES 17

@EliasMerabet On the Form where the Data Cards are, is the Item property set to an item before the 

Office365Outlook.SendEmail

Formula is run?

 

Also, if you can see the Form, does it appear to have any values in it at all or is it all blanks? 

Thanks @poweractivate 

I use a SubmitForm in a button outside of the form

EliasMerabet_0-1634805589351.png

 

Then I send the  email:

SubmitForm(Form7);
Office365Outlook.SendEmail(Dropdown2.Selected.Usuario, "Tarea Creada: " & DataCardValue58.Text & ". Usuario: " &DataCardValue65.Text & ". Número de ID: " & Text(_ID), _Contenido)

 



@EliasMerabet There are lot of blank values there. Can you take screenshot of Usario dropdown so I could see if it is blank or not too? 

By the way, is everything blank or just specific things?

What comes up blank in the email? Is it ALL or SOME of the following:

Usuario

DataCardValue65.Text

_ID (what is _ID?)

 

By the way _Contenido, - is it entirely blank, or just the Datacard values?

If it is just the Data Card values, tell me if these are blank in the email:

DataCardValue60.Text

DataCardValue59.Text,

DataCardValue58.Text

Dropdown2.Selected.Nombre (and which dropdown is this, and is the dropdown visually blank too on the Form?)

 

Then go through the above and check all the corresponding Controls and DataCardValues too, and see if anything is blank visually as it appears  in the form too.

 

If possible take some more screenshots (if it is allowed and possible) to see if those fields are blank even just visually and obviously right on the form itself. If they are blank, obviously they'd be blank in the e-mail too and the problem is they are blank on the Form (probably because Item property of Form is not resolving to any actual Record of any kind)

 

 

Thanks @poweractivate 

 

_Contenido is blank just for all the DataCardValues


This is the form filled

EliasMerabet_0-1634806127323.png

This is the button´s code:

SubmitForm(Form7);
Set(_ID,LookUp(Tareas, Title = DataCardValue58.Text, ID));
Set(_Usuario, DataCardValue65.Text);
Set(_Contenido, Concatenate("FYI ==> Hola ", Dropdown2.Selected.Nombre, " <br /> El usuario ", _Usuario, "ha creado la tarea número ", Text(_ID), ", con título ", DataCardValue58.Text, " y cuya descripción es <", DataCardValue59.Text, ">. Las horas programas serán: ", DataCardValue60.Text));
Office365Outlook.SendEmail(Dropdown2.Selected.Usuario, "Tarea Creada: " & DataCardValue58.Text & ". Usuario: " &DataCardValue65.Text & ". Número de ID: " & Text(_ID), _Contenido);
ResetForm(Form7)

 

This is the email result
Subject: Tarea Creada: . Usuario: . Número de ID:

Content: 

FYI ==> Hola Elias <br /> El usuario ha creado la tarea número , con título  y cuya descripción es <>. Las horas programas serán:

 

For dropdown2.Selected.Nombre and Dropdown2.Selected.Usuario (Dropdown2 which one is next to the button) works fine. Just is not working for any input allocated in a card in the form (but they are working for el SubmitForm).

May I help you with anything else?

Cheers 🙂

@EliasMerabet Tell me what is DefaultMode of the Form set to? Is it FormMode.Edit or FormMode.New?

 

Also as a test can you take out the SubmitForm temporarily, and see if it works for some reason?

If it does, after that, it will probably still need to be put back in there somewhere but for now, just check if it works without it.

It is in FormMode.New

If I take out the SubmitForm, It works.

@EliasMerabet Yes that is because FormMode.New upon call to SubmitForm it will change the Mode to Edit and it will clear out everything I believe.

 

To resolve it move SubmitForm to after the Email related Formulas (i.e. maybe right above ResetForm) and tell me if it works then.

 

If it works then maybe you have solved it after that.

It works. But I don´t really like the solution. I am sending a confirmation email before I submit the record... If finally the user can´t add the record? (the submit fails in some way)

 

What do you think?
Do you know another approach? 🙂

@EliasMerabet 

 

So to do this

 

1. Put SubmitForm(Form7)

2. Now take everything out from below it and move all of it to OnSuccess  of Form7, and then inside OnSuccess property of Form7, always from the formulas inside, access Self.LastSubmit.YourNameOfFieldHere instead of DataCardValue for all of them then it will work. At the very end of this OnSuccess as very last formula, you can put the ResetForm as well. 

3. Check if above works for you instead.

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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