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

Unable to Submit Form

Hello Everyone,

 

I am building an app based on a SharePoint List. I have created a screen where i have added two forms, one is View (where only columns which would be read only to the users) and Edit (10 columns where users will have to add entries).

I have to change the status of the item which will be created in to the list hence i used patch function. In addition to that i also want the user inputs to be appended in to the list item hence i am using SubmitForm() function. But except submit form action all the other things are working fine. I am not sure where i am doing mistake. Can anyone please help me understand where i am going wrong? Below the code:

 

If(InputForm.Valid,
Set(
    VarItem,
    If(
        DataCardValue73.Selected.Value = "Complex",
        Patch(
            'List Name',
            VarItem,
            {
                Status: {Value: "Under VSM Review"}
            }
        ),
        Patch(
            'List Name',
            VarItem,
            {
                Status: {Value: "In Development"}
            }
        )
    )
);
If(
    DataCardValue73.Selected.Value = "Complex",
    Office365Outlook.SendEmailV2(),
    Office365Outlook.SendEmailV2());
    Office365Outlook.SendEmailV2(); SubmitForm(InputForm); Navigate(Screen_Intake_List),
Notify("Comments are mandatory hence please enter the details in form and then click on the 'Approve' button.",Error))

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @AkshayManke ,

You are setting varItem to the returned Patch and then also using it as the record reference. If you have the ID of the record you want to Patch to, this will work

If(InputForm.Valid,
   With(
      { 
         wValue:
         If(
            DataCardValue73.Selected.Value = "Complex",
            "Under VSM Review",
            "In Development"
         )
      },
      Patch(
         'List Name',
         {ID:YourIDNo},
         {Status: {Value: wValue)}
      )
   )
);
If(
   DataCardValue73.Selected.Value = "Complex",
   Office365Outlook.SendEmailV2(),
   Office365Outlook.SendEmailV2());
   Office365Outlook.SendEmailV2(); 
   SubmitForm(InputForm); 
   Navigate(Screen_Intake_List),
   Notify("Comments are mandatory hence please enter the details in form and then click on the 'Approve' button.",Error)
)

 

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.

 

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @AkshayManke ,

You are setting varItem to the returned Patch and then also using it as the record reference. If you have the ID of the record you want to Patch to, this will work

If(InputForm.Valid,
   With(
      { 
         wValue:
         If(
            DataCardValue73.Selected.Value = "Complex",
            "Under VSM Review",
            "In Development"
         )
      },
      Patch(
         'List Name',
         {ID:YourIDNo},
         {Status: {Value: wValue)}
      )
   )
);
If(
   DataCardValue73.Selected.Value = "Complex",
   Office365Outlook.SendEmailV2(),
   Office365Outlook.SendEmailV2());
   Office365Outlook.SendEmailV2(); 
   SubmitForm(InputForm); 
   Navigate(Screen_Intake_List),
   Notify("Comments are mandatory hence please enter the details in form and then click on the 'Approve' button.",Error)
)

 

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.

 

View solution in original post

Hello @WarrenBelz,

 

Many Thanks for the help. I tried to add the SubmitForm() in the top (before the patch function) and it worked as expected, below the code.

If(InputForm.Valid,
SubmitForm(InputForm);
Set(
    VarItem,
    If(
        DataCardValue73.Selected.Value = "Complex",
        Patch(
            'List Name',
            VarItem,
            {
                Status: {Value: "Under VSM Review"}
            }
        ),
        Patch(
            'List Name',
            VarItem,
            {
                Status: {Value: "In Development"}
            }
        )
    )
);
If(
    DataCardValue73.Selected.Value = "Complex",
    Office365Outlook.SendEmailV2(),
    Office365Outlook.SendEmailV2());
    Office365Outlook.SendEmailV2(); Navigate(Screen_Intake_List),
Notify("Comments are mandatory hence please enter the details in form and then click on the 'Approve' button.",Error))

However i am trying your solution as well where you have suggested to use With function. I am accepting it as solution. 

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 (48,563)