cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SumanthDundi7
Helper IV
Helper IV

Unable to View or Edit selected item after submitting an item using PowerApps to SharePoint List

I have created a PowerApp with 3 Forms. 1st Form has a choice column. Based on what user selected in the 1st Form, either 2nd Form or 3rd Form will be navigated. 

Lets say on the first form I have Choice Column with values X & Y. If user selects Value X then it will navigate to form that is created for X Type. If user selects Value Y then it will navigate to form that is created for Y Type.

 

After submitting, I want to view directly the form of X Type if the choice selected is X or else I want to view directly the form of Y Type if the choice selected is Y.

How can I achieve this in PowerApps? Please help. 

4 REPLIES 4
Mr-Dang-MSFT
Power Apps
Power Apps

My understanding: 

  • You have want the first form to navigate to a different screen based on what is selected: Choice X or Choice Y.
  • I'm going to assume you have a button, Button1, that will perform the navigation once you're done filling out Form1.

 

Lots of ways you can do this. The shortest method may be a Switch() statement.

You can set Button1.OnSelect to:

Switch(
    Dropdown1.Selected.Value,
    X,Screen2,
    Y,Screen3
)

I'm not sure what kind of control you're using for the choices, so you'll need to change that to your needs. 

 

I'm also not sure what kind of data types X and Y are. I'm assuming they are text in this scenario. You'll need to match their type with what's picked in the dropdown/combobox control you're using.

Mr.Dang, Actually I was able to accomplish navigating/swithcing between screens and submit the form based on choice selected.

 

But here is my actual blocker:

After submitting, I want to view directly the form of X Type (if the choice selected is X) or else I want to view directly the form of Y Type(if the choice selected is Y).

(Something that needs to formulated in OnView property?!)

v-xida-msft
Community Support
Community Support

Hi @SumanthDundi7 ,

Could you please share a screenshot about your app's configuration?
Do you want to view the X Type form (or Y Type form) directly after you submit your X Type form (or Y type form)?

Further, do you custom a form in your SP List using PowerApps?

 

Based on the scenario that you mentioned, I suppose that you custom a form in your SP list using PowerApps, is it true?

 

I have made a test on my side, please consider take a try with the following workaround:

1. Remove the RequestHide() formula from the OnSuccess property of your first Edit form.

2. Set the OnSuccess property of the X Type form to following:

Set(CurrentXFormData, XTypeForm.LastSubmit);
Navigate(XTypeScreen); /* <-- XTypeScreen contains the XTypeForm */
ViewForm(XTypeForm)

set the Item property of the X Type form to following:

If(
   !IsBlank(CurrentXFormData),
CurrentXFormData )

3. Set the OnSuccess property of the Y Type form to following:

Set(CurrentYFormData, YTypeForm.LastSubmit);
Navigate(YTypeScreen); /* <-- YTypeScreen contains the YTypeForm */
ViewForm(YTypeForm)

set the Item property of the Y Type form to following:

If(
   !IsBlank(CurrentYFormData),
CurrentYFormData )

 

4. Set the OnCancel property of the SharePointIntegration control to following:

ResetForm(FirstForm);
ResetForm(XTypeForm);
ResetForm(YTypeForm);
RequestHide(); /* <-- hiden the custom form */

5. Set the OnNew property of the SharePointIntegration control to following:

NewForm(FirstForm);NewForm(XTypeForm);NewForm(YTypeForm);
Set(CurrentXFormData, Blank())
Set(CurrentYFormData, Blank())

6. Set the OnSave property of the SharePointIntegration control to following:

If(
    ChoiceFiledDropdownBox.Selected.Value = "X",
    SubmitForm(XTypeForm),
    ChoiceFiledDropdownBox.Selected.Value = "Y",
     SubmitForm(YTypeForm)
)

Please take a try with above solution, then check if the issue is solved.

Note: I assume that you use SubmitForm function to submit your form data.

 

Best regards,

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

Hi @v-xida-msft,

 

Sorry if it is understood that way. But thanks alot for your reply. 

 

Here is what I am looking for:

" I want to view the X type form from the SharePoint list directly if the choice selected is X related type." Likewise, for Y type form. But not right after submitting! 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,241)