1

There are two types of tickets in my list, and since content type isn't currently accessible in PowerApps (Microsoft admits a bug on this one), I am simply storing a hardcoded text value instead of the content type name and reading from that field to perform my logic. If the user clicks on item of type A then I want it to show the Type A display form, etc.

For the sake of illustration, let's say we have two items on the list, one of type A and one of type B.

Here's how it's currently flowing when the user performs these actions in sequence:

1) User clicks on item A,  Home screen opens.  (Should be View Type A screen)
2) User clicks on item A again, View Type A screen opens. (This is correct)
3) User clicks on item B,  View Type A opens but with item B data. (Clearly wrong)
4) User clicks on item B again,  View Type B opens with item B data (this is correct)

In all cases, whenever a screen is opening, it first displays the last-shown screen for a split second and then switches to the one it's really trying to display.

This is the code in my SharePointIntegration.OnView:

    Switch(SharePointIntegration.Selected.'My Text Field',
        "Type A", ViewForm(frmViewTypeA);Navigate(ViewTypeAScreen),
        "Type B", ViewForm(frmViewTypeB);Navigate(ViewTypeBScreen))

It feels to me like something isn't getting cleared or reset properly, but I don't know where else to look or what I'm looking for.

Thanks very much

1 Answer 1

0

The official formula is as follows(FirstName is a text input control):

Switch( FirstName.Text, "Carlos", Navigate( Screen1, ScreenTransition.None ), "Kirstin", Navigate( Screen2, ScreenTransition.None ), "John", Navigate( Screen3, ScreenTransition.None ) )

Reference: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if#branching-in-behavior-formulas

1
  • Thank you, Julie. It appears the only difference between my formula and yours was the ViewForm function, and that I'm not using a screen transition. I removed the ViewForm functions, saved/published, opened a new browser and tried again, but still getting the same one-step-behind behavior. Didn't seem to make any difference.
    – LegalEagle
    Apr 22, 2020 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.