cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AkshayManke
Continued Contributor
Continued Contributor

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
WarrenBelz
Super User
Super User

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
WarrenBelz
Super User
Super User

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

AkshayManke
Continued Contributor
Continued Contributor

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,503)