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

Two Forms to Submit, both required - erroring on one but still submitting

I have two forms:

Form3 is the completion of a 3 sheet survey which loads to the CDS

Form4 are attachments which load to sharepoint

 

When you click submit without attaching any documents to Form4, you get an error but the form still submits. I'd like for the form to not submit unless you have attached documents. I suspect I need to update the code in Form3 but I wasn't sure how to move forward.

 

Submit_Button:

On Select - Set(varSubmitMode,"submit");SubmitForm(Form3); SubmitForm(Form4)

 

Form4

Required = true

 

Form3

On Select:

If(
varSubmitMode = "submit",

Patch(
PS_PAF_BidPros,
Form3.LastSubmit,
{StatusSQL: "Submitted"}
));

Navigate(Success_Screen,ScreenTransition.Fade)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Two Forms to Submit, both required - erroring on one but still submitting

Hi @TesDA 

 

You could have a variable "HasAttachment" that you set to true once the attachment is uploaded, the on the OnSelect for the button, you can include:

If(HasAttachment = true,SubmitForm(Form4),"")

 

This formula will check the variable value, if True then the form4 is going to be submitted, otherwise you can include an error message and the form won't be submitted.

 

Best Regards,

--

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution

View solution in original post

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Re: Two Forms to Submit, both required - erroring on one but still submitting

Hi @TesDA 

 

You could have a variable "HasAttachment" that you set to true once the attachment is uploaded, the on the OnSelect for the button, you can include:

If(HasAttachment = true,SubmitForm(Form4),"")

 

This formula will check the variable value, if True then the form4 is going to be submitted, otherwise you can include an error message and the form won't be submitted.

 

Best Regards,

--

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution

View solution in original post

Highlighted
Community Support
Community Support

Re: Two Forms to Submit, both required - erroring on one but still submitting

Hi @TesDA ,

Do you only want to submit the form that has attached attachments?

If so, I suggest you add a if statement in your submit formula.

Firstly, please check the attachments control names in form3 and form4.

Then you could use this formula to justify whether there's attachments attached in the fom:

IsEmpty(DataCardValue21.Attachments)

// DataCardValue21 is my attachments control name in my form, you just need to replace with the names in form3 and form4.

 

The formula to submit:

If(!IsEmpty(DataCardValue21form3.Attachments),SubmitForm(Form3));
If(!IsEmpty(DataCardValue21form4.Attachments),SubmitForm(Form4))
//please replace DataCardValue21form3 with attchments control name in form3
please replace DataCardValue21form4 with attchments control name in form4

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,254)