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

Mandatory fields

Hello !

I have an application that collect data and then sends it to an email.

 

/// SELECTEAZA CONTACTE EMAIL //
Set(_emailRecipientString, Concat(MyPeople, Mail & ";")); 

// TRIMITE MAIL AUTOMAT URMATOARELOR PERSOANE: //
Office365Outlook.SendEmailV2(_emailRecipientString & "ax@suppliers.tenaris.com",


// COLECTEAZA DATELE CARE TREBUIE TRIMISE IN EMAIL IN COLECTIA Date_email //


Collect(Mesaj_email, 
{
Mesaj: TextEmailMessage3_5.Text});

Collect(
    Date_email,
    
 {  
 Data_crearii_cererii : DatePicker0.SelectedDate,
 Utilizator : TextInput0.Text,
 Mesaj:TextEmailMessage3_5.Text,
     
 Adresa : TextInput2.Text, 
 Adresa_incarcare : TextInput3.Text,
Tipologie_mijloc_de_transport : Dropdown1.Selected.Value,
Tip_mijloc_transport : Dropdown2.Selected.Value,
Destinatar : TextInput4.Text,
Adresa_de_descarcare : TextInput5.Text,
Codul_postal : TextInput6.Text,


Denumirea_marfii : Dropdown3.Selected.Value,
 Lungime_maxima : TextInput7.Text, 
 Numar_de_bucati  : TextInput8.Text,
Diametru_tevi_legaturi : TextInput9.Text,
Greutate_totala_de_livrat  : TextInput10.Text,
Numarul_de_mijloace_de_transport_solicitate : TextInput11.Text,
Ritmul_livrarii  : TextInput12.Text,
Valoare_marfa_camion : TextInput13.Text,

Data_cand_marfa_este_RFD : DatePicker1.SelectedDate,
     Data_solicitata_pentru_incarcare :DatePicker2.SelectedDate,
     Data_solicitata_pentru_descarcare :DatePicker3.SelectedDate,
     Data_alternativa_pentru_incarcare : DatePicker4.SelectedDate,
     Data_alternativa_pentru_descarcare :DatePicker5.SelectedDate,
     Program_de_lucru_al_destinatarului : TextInput13.Text,

Modul_de_incarcare : Checkbox1.Text,
 Modul_de_descarcare : Checkbox2.Text, 
 Declarant_vamal_la_export : TextInput15.Text,
 Adresa_unde_se_face_vama_la_export : TextInput16.Text,
Declarant_vamal_la_import : TextInput17.Text,
Adresa_unde_se_face_vama_la_import : TextInput18.Text,
NOTE : TextInput19.Text
}); 


// MESAJ AUTOMAT EMAIL //
    TextEmailSubject_3,   
     Concat(
        Date_email,
         "</br></br>Buna ziua! </br>" &Mesaj &Char(10) &"</br>" & "</br>" & "</br>" &

         "<b><p style=""color:#FF0000"">EXPEDITIA</p></b>" &
          "<b>Expeditor,adresa: </b>" & Adresa & Char(10) &"</br>" &
         "</br><b>Adresa de incarcare (daca difera de cea a expeditorului): </b>" & Adresa_incarcare & Char(10) & "</br>" &
         "</br><b>Tipul de mijloc de transport solicitat: </b>" &Tip_mijloc_transport & Char(10) &"</br>" &


         "</br> <b><p style=""color:#FF0000"">DESTINATIA</p></b>" &
          "<b>Destinatar: </b>" & Destinatar & Char(10) &"</br>" &
           "</br><b>Adresa de descarcare (daca difera de cea a destinatarului): </b>" & Adresa_de_descarcare & Char(10) & "</br>" &
            "</br><b>Codul postal: </b>" & Codul_postal & Char(10) &  "</br>" &


            "<b><p style=""color:#FF0000"">TIPUL MARFII</p></b>" &
            "<b>Denumirea marfii: </b>" &Denumirea_marfii & Char(10) &"</br>" &
            "</br><b>Lungime maxima: </b>" & Lungime_maxima & Char(10) &"</br>" &
             "</br><b>Numar de bucati: </b>" & Numar_de_bucati & Char(10) &"</br>" &
              "</br><b>Diametru tevi/legaturi: </b>" & Diametru_tevi_legaturi & Char(10) & "</br>" &
              "</br><b>Greutate totala de livrat: </b>" & Greutate_totala_de_livrat & Char(10) & "</br>" &
              "</br><b>Numarul de mijloace de transport solicitate </b>: " & Numarul_de_mijloace_de_transport_solicitate & Char(10) & "</br>" &
              "</br><b>Ritmul livrarii [camioane/zi]  </b>: " & Ritmul_livrarii & Char(10) & "</br>" &
               "</br><b>Valoare marfa/camion: </b>" & Valoare_marfa_camion & Char(10) &"</br>" &


               "<b><p style=""color:#FF0000"">DATELE INCARCARII/DESCARCARII</p></b>" &
                "<b>Data cand marfa este RFD : </b>" & Data_cand_marfa_este_RFD & Char(10) &"</br>" &
                 "</br><b>Data solicitata pentru incarcare </b>: " & Data_solicitata_pentru_incarcare & Char(10) & "</br>" &
                 "</br><b>Data solicitata pentru descarcare </b>: " & Data_solicitata_pentru_descarcare & Char(10) & "</br>" &
                 "</br><b>Data_alternativa_pentru_incarcare : </b>" & Data_alternativa_pentru_incarcare & Char(10) & "</br>" &
                 "</br><b>Data_alternativa_pentru_descarcare : </b>" & Data_alternativa_pentru_descarcare & Char(10) & "</br>" &
                 "</br><b>Program_de_lucru_al_destinatarului : </b>" & Program_de_lucru_al_destinatarului & Char(10) & "</br>" &


                 "<b><p style=""color:#FF0000"">ALTE INFORMATII</p></b>" &
                 "<b>Modul de incarcare : </b>" & Modul_de_incarcare & Char(10) & "</br>" &
                 " </br><b>Modul_de_descarcare : </b>" & Modul_de_descarcare & Char(10) &"</br>" &
                  "</br><b>Declarant_vamal_la_export : </b>" & Declarant_vamal_la_export & Char(10) &"</br>" &
                   "</br><b>Adresa_unde_se_face_vama_la_export : </b>" & Adresa_unde_se_face_vama_la_export & Char(10) &"</br>" &
                    "</br><b>Declarant_vamal_la_import   </b>: " & Declarant_vamal_la_export & Char(10) &"</br>" &
                    "</br><b>Adresa_unde_se_face_vama_la_import   </b>: " & Adresa_unde_se_face_vama_la_import & Char(10) &"</br>" &
                    
                    
                    "<b><p style=""color:#FF0000"">NOTE</p></b>"  & NOTE & Char(10) 
    )
);

// COLECTEAZA DATE IN COLECTIA Cerere //
Collect(
    Cerere,
    
 {  
     Titlul: TextEmailSubject_3.Text,
 Data_crearii_cererii : DatePicker0.SelectedDate,
 Utilizator : TextInput0.Text,
 
 Adresa : TextInput2.Text, 
 Adresa_incarcare : TextInput3.Text,
Tipologie_mijloc_de_transport : Dropdown1.SelectedText,
Tip_mijloc_transport : Dropdown2.SelectedText,
Destinatar : TextInput4.Text,
Adresa_de_descarcare : TextInput5.Text,
Codul_postal : TextInput6.Text,

Denumirea_marfii : Dropdown3.SelectedText,
 Lungime_maxima : TextInput7.Text, 
 Numar_de_bucati  : TextInput8.Text,
Diametru_tevi_legaturi : TextInput9.Text,
Greutate_totala_de_livrat  : TextInput10.Text,
Numarul_de_mijloace_de_transport_solicitate : TextInput11.Text,
Ritmul_livrarii  : TextInput12.Text,
Valoare_marfa_camion : TextInput13.Text,

Data_cand_marfa_este_RFD : DatePicker1.SelectedDate,
     Data_solicitata_pentru_incarcare :DatePicker2.SelectedDate,
     Data_solicitata_pentru_descarcare :DatePicker3.SelectedDate,
     Data_alternativa_pentru_incarcare : DatePicker4.SelectedDate,
     Data_alternativa_pentru_descarcare :DatePicker5.SelectedDate,
     Program_de_lucru_al_destinatarului : TextInput13.Text,

Modul_de_incarcare : Checkbox1.Text,
 Modul_de_descarcare : Checkbox2.Text, 
 Declarant_vamal_la_export : TextInput15.Text,
 Adresa_unde_se_face_vama_la_export : TextInput16.Text,
Declarant_vamal_la_import : TextInput17.Text,
Adresa_unde_se_face_vama_la_import : TextInput18.Text,
NOTE : TextInput19.Text
});


// CONEXIUNE TABEL EXCEL //
ForAll(Date_email,
       Patch(Cerere_Excel,
               Defaults(Cerere_Excel),
               {Adresa :Date_email[@Adresa],
               Adresa_incarcare :Date_email[@Adresa_incarcare],
               Tipologie_mijloc_de_transport :Date_email[@Tipologie_mijloc_de_transport],
               Tip_mijloc_transport :Date_email[@Tip_mijloc_transport],
               Destinatar:Date_email[@Destinatar],
               Adresa_de_descarcare:Date_email[@Adresa_de_descarcare],
               Codul_postal :Date_email[@Codul_postal],
               Denumirea_marfii :Date_email[@Denumirea_marfii],
               Lungime_maxima :Date_email[@Lungime_maxima],
               Numar_de_bucati :Date_email[@Numar_de_bucati],
               Diametru_tevi_legaturi:Date_email[@Diametru_tevi_legaturi],
               Greutate_totala_de_livrat:Date_email[@Greutate_totala_de_livrat],
               Numarul_de_mijloace_de_transport_solicitate:Date_email[@Numarul_de_mijloace_de_transport_solicitate],
               Ritmul_livrarii :Date_email[@Ritmul_livrarii],
               Valoare_marfa_camion :Date_email[@Valoare_marfa_camion],
               Data_cand_marfa_este_RFD :Date_email[@Data_cand_marfa_este_RFD],
              Data_solicitata_pentru_incarcare :Date_email[@Data_solicitata_pentru_incarcare],
              Data_solicitata_pentru_descarcare :Date_email[@Data_solicitata_pentru_descarcare],
              Data_alternativa_pentru_incarcare :Date_email[@Data_alternativa_pentru_incarcare],
               Data_alternativa_pentru_descarcare:Date_email[@Data_alternativa_pentru_descarcare],
                Program_de_lucru_al_destinatarului:Date_email[@Data_alternativa_pentru_incarcare],
                Modul_de_incarcare:Date_email[@Modul_de_incarcare],
                Declarant_vamal_la_export:Date_email[@Declarant_vamal_la_export],
                Adresa_unde_se_face_vama_la_export:Date_email[@Adresa_unde_se_face_vama_la_export],
                 Declarant_vamal_la_import:Date_email[@Declarant_vamal_la_import],
                Adresa_unde_se_face_vama_la_import:Date_email[@Adresa_unde_se_face_vama_la_import],
                  'NOTE ':Date_email[@NOTE]     
               }
              )
      );
      


// RESETEAZA CAMPURILE //
Reset(TextEmailSubject_3);           
Reset(TextEmailMessage3_5); 
Reset(DatePicker0);
Reset(TextInput0);
Reset(TextInput2);
Reset(TextInput3);
Reset(Dropdown1);
Reset(Dropdown2);
Reset(TextInput4);
Reset(TextInput5);
Reset(TextInput6);
Reset(Dropdown3);
Reset(TextInput7);
Reset(TextInput8);
Reset(TextInput9);
Reset(TextInput10);
Reset(TextInput11);
Reset(TextInput12);
Reset(TextInput13);
Reset(DatePicker1);
Reset(DatePicker2);
Reset(DatePicker3);
Reset(DatePicker4);
Reset(DatePicker5);
Reset(TextInput14);

Reset(TextInput15);
Reset(TextInput16);
Reset(TextInput17);
Reset(TextInput18);
Reset(TextInput19);
Clear(Mesaj_email);
Clear(Date_email);
Clear(MyPeople);

Navigate(Split, ScreenTransition.Fade)

This is the code that I wrote to send the email.

If I want to make the fields below mandatory, how can I do that?

  1. Data_crearii_cererii,
  2. Utilizator
  3. Tipologie_mijloc_de_transport

 

3 REPLIES 3
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Alice23 ,

if you are using Form then Please select the Datacard and set the "Required" Property true.
for reference - 

VijayTailor_0-1631607310845.png

But if you using simple text box then you need to add logic for check value and display error msg as label.

Thanks,
Hope this information help you to resolve your issue.

Vijay

@VijayTailor  I am using text boxes. How can I write the code? Can you give me an example please?

VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Alice23 ,

Please find the solution below for your issue.
Set Label Visible Property - If(Status=true,true,false)
Button OnSelect Property - If((Len(TextInput1.Text)>0 && Len(TextInput1_1.Text)>0 && Len(TextInput1_2.Text)>0)=true,Set(Status,false),Set(Status,true))

Thanks,
Vijay 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,834)