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

Not submit a form if a validation is empty

Hi everyone,

 

I've a question, a I've a form that sends a email if all the records are complete (required), but the problem is if a record is empty the submit still works and send the email and update the data.

This is my formula.

 

If(
DataCardValue66.SelectedText.Value = "EN GESTIÓN";
SubmitForm(Form3);;
Navigate(
RetenciónInside;
ScreenTransition.None
);
If(
DataCardValue66.SelectedText.Value = "REPROGRAMADO";
SubmitForm(Form3);;
Navigate(
RetenciónInside;
ScreenTransition.None
);
If( DataCardValue66.SelectedText.Value = "NO CONTENIDO";
SubmitForm(Form3);;
Navigate(
RetenciónInside;
ScreenTransition.None
);

Office365Outlook.SendEmailV2(
"Sergio.Rivadeneyra@prosegur.com; juan.rincon@prosegur.com; carmen.becerra@prosegur.com; alan.espinoza@prosegur.com; diego.fajardo@prosegur.com; "&DataCardValue70;
"Contención comercial: " & "Contrato: " &DataCardValue21 & " Actividad: "&DataCardValue71;
"Se realiza la contención del contrato. " & DataCardValue21 & " Se adjunta conformidad del cliente.";
{
Attachments: AddColumns(
RenameColumns(
DataCardValue69.Attachments;
"Value";
"ContentBytes"
);
"@odatabyte";
""
)
}
)
)
);
ClearCollect(CollectAdjunto;DataCardValue69.Attachments);
SubmitForm(Form3);;
Navigate(
RetenciónInside;
ScreenTransition.None
)
)

I would like to know, how i can do to not submit and send the information if a record is empty as a required.

 

I'll waitinf for your comments.

 

Best Regards.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Not submit a form if a validation is empty

Hi @diegoaff92 ,

Note that I have not validated he email part - just used your existing code - also not completely sure on your logic, but the below will submit the form and send the email if the status is one of the three values, otherwise do a collection and submit the form.

With(
   {
      vSelect:DataCardValue66.SelectedText.Value
   },
   If(
      vSelect ="EN GESTIÓN" || vSelect= "REPROGRAMADO" || vSelect = "NO CONTENIDO"
      Office365Outlook.SendEmailV2(
         "Sergio.Rivadeneyra@prosegur.com; 
         juan.rincon@prosegur.com; 
         carmen.becerra@prosegur.com; 
         alan.espinoza@prosegur.com; 
         diego.fajardo@prosegur.com;
         "&DataCardValue70;         
         "Contención comercial: " & "Contrato: " &
         DataCardValue21 & " Actividad: "&DataCardValue71;
         "Se realiza la contención del contrato. " & 
         DataCardValue21 & " Se adjunta conformidad del cliente.";
         {
            Attachments: 
            AddColumns(
               RenameColumns(
                  DataCardValue69.Attachments;
                  "Value";
                  "ContentBytes"
               );
              "@odatabyte";
              ""
            )
         }
      );
      ClearCollect(CollectAdjunto;DataCardValue69.Attachments);;
   )
);;
SubmitForm(Form3);;
Navigate(RetenciónInside;ScreenTransition.None)

View solution in original post

8 REPLIES 8
Highlighted
Frequent Visitor

Re: Not submit a form if a validation is empty

@diegoaff92 , the formula contains "NO CONTENIDO"...

In this place you want to reset form (not submit) and send the notification?

 

Or you are trying to write above all this another If IsBlank( (SOMETHING) )  then only SendEmail ?

Highlighted
Helper II
Helper II

Re: Not submit a form if a validation is empty

Hi @UAFliudMy and thank you for your soon reply.

 

My mistake for not gave all the details, sorry. The email send if it's "CONTENIDO", in this part my editform has a required item thatr is attachments, if this required item its not complete the sudmit and send information should not work, but stills works, even the property "required" its true.

Highlighted
Frequent Visitor

Re: Not submit a form if a validation is empty

It's complicated for me to understand.
If the value of the field contains "CONTENIDO" or "WHATEVER" or "BLA_BLA", and the field require value, the logic will pass everything, because the field is not empty.

Highlighted
Helper II
Helper II

Re: Not submit a form if a validation is empty

Hi, thank you for your soon reply,

I'll send you some pics for a better vision.

 

Sin título.png

Highlighted
Community Champion
Community Champion

Re: Not submit a form if a validation is empty

Hi @diegoaff92 ,

Note that I have not validated he email part - just used your existing code - also not completely sure on your logic, but the below will submit the form and send the email if the status is one of the three values, otherwise do a collection and submit the form.

With(
   {
      vSelect:DataCardValue66.SelectedText.Value
   },
   If(
      vSelect ="EN GESTIÓN" || vSelect= "REPROGRAMADO" || vSelect = "NO CONTENIDO"
      Office365Outlook.SendEmailV2(
         "Sergio.Rivadeneyra@prosegur.com; 
         juan.rincon@prosegur.com; 
         carmen.becerra@prosegur.com; 
         alan.espinoza@prosegur.com; 
         diego.fajardo@prosegur.com;
         "&DataCardValue70;         
         "Contención comercial: " & "Contrato: " &
         DataCardValue21 & " Actividad: "&DataCardValue71;
         "Se realiza la contención del contrato. " & 
         DataCardValue21 & " Se adjunta conformidad del cliente.";
         {
            Attachments: 
            AddColumns(
               RenameColumns(
                  DataCardValue69.Attachments;
                  "Value";
                  "ContentBytes"
               );
              "@odatabyte";
              ""
            )
         }
      );
      ClearCollect(CollectAdjunto;DataCardValue69.Attachments);;
   )
);;
SubmitForm(Form3);;
Navigate(RetenciónInside;ScreenTransition.None)

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Not submit a form if a validation is empty

Hi @diegoaff92 

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

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.

Highlighted
Helper II
Helper II

Re: Not submit a form if a validation is empty

Hi Mr.@WarrenBelz 
Thank you for your reply and I'm really sorry for answer you really late, I had some personal problems.

 

I could resolve my problem thank you for worried about that.

 

Best Regards.

 

Diego Fajardo Feijoo.

Highlighted
Community Champion
Community Champion

Re: Not submit a form if a validation is empty

Thanks @diegoaff92 ,

If my post helped you solve your issue, please consider Accept as solution This will help others find it more readily. It also closes the item.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (8,652)