cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

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
Microsoft
Microsoft

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
Microsoft
Microsoft

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

Community Support
Community Support

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (71,004)