How to display only certain column values from a sharepoint list when pressed on a button tab in Power Apps?

1.2k views Asked by At

I am creating an app in Power apps based on a Sharepoint List. Consider it has two pages.In page 1 I have 2 buttons b1 & b2. When i click on b1 it should go to page 2 & display only some of the column values in my Sharepoint list.And the rest of the column values should be displayed when i click on button b2 in page 1.The point is - what condition should i give to the buttons to achieve this Anyone please help on these.

[when i click on introduction button it should go to the 2nd page and shoulf display the first 4 columns only and when i click on solution overview button it should go to the same old page & dispaly the rest of the columns only

1

There are 1 answers

2
ALI RAZA ZAFAR On BEST ANSWER

You need to follow three steps:

  1. Create a context variable on the onvisible property of the form on MultiPage: UpdateContext( { showAllFields: false } ), This creates a variable showAllFields which is set to false.

  2. Select the datacard you want to hide on default and set the visible property to showAllFields, thiswill show the datacard when the variable is true and hide it when it's false.

  3. Add a button and put the following on the onselect property: UpdateContext({showAllFields:!showAllFields}). This will switch the variable from false to true if it's false and from true to false if it's true.

To Navigate between screens:

   Navigate( Screen [, Transition [, UpdateContextRecord ] ] )

Screen - Required. The screen to display.

Transition - Optional. The visual transition to use between the current screen and the next screen. See the list of valid values for this argument earlier in this article. The default value is None.

UpdateContextRecord - Optional. A record that contains the name of at least one column and a value for each column. This record updates the context variables of the new screen as if passed to the UpdateContext function.

So in your case if you don't want to pass any context variable, just use:

  Navigate( Page2, ScreenTransition.Fade ) on button select

Page2: Screen Name ScreenTransition: Effect used to switch the screens.

In Order to go back to previous Page use following:

      Back(ScreenTransition.Fade)

or you can use

      Navigate(page1, ScreenTransition.Fade)

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps 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!