cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

"Item" selected in Screen1 to be used as 'input' in Screen2

Hello everyone,

I have stumbled upon yet another thing I do not know in PowerApp, and thus, am here asking if anyone of you could help me.

My problem now is that in screen 1 "project list" I have a list of all the projects an user has items on:

multiScreen1_forum.png

From that one, I select one and I will want for my browse screen to show it with "project 2" as the one selected, for example. The problem is I do not know how to link that the selected value there will show as the one I see on the browse screen.

multiScreen2_forum.png

So here instead of seeing all the items of "project1" and the dropdown list have selected "project1", I would want to have it selected on "project2". Due to the way the droplist and gallery are coded:

- Droplist:

Distinct(Filter(demo_project;User().Email in ShowColumns(Encargado;"Email"));Título)

- Gallery:

SortByColumns(Filter(demo_project; Título = ListaProyectos.Selected.Value && User().Email in ShowColumns(Encargado;"Email"));"Fecha_x0020_Termino";If(SortDescending1;Descending;Ascending))

What should I do sothe selected option in the first screenshot is used as an "input" so to speak, in the Gallery, so it shows the items belonging to that one? The droplist would also have selected that option, and the user would still be able to navigate options from it.

 

Thanks in advance,

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

@FelipeCaru 

 

For your DropDown you should have:

    Items: Distinct(Filter(demo_project;User().Email in ShowColumns(Encargado;"Email"));Título) (assuming this works for you)

    Value: Result

    Default: galleryListaProyecto.Selected.Title  (assuming the value is in Title - if not, change as needed)

 

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

@FelipeCaru 

This might be a quick answer, so not needed in another thread.

 

Let's start with the buttons - set the OnSelect action as follows (in the order I see in the photo):

   Button1 OnStart :  Set(_myFilter, "completado")

   Button2 OnStart :  Set(_myFilter, "tiempo")

   Button3 OnStart :  Set(_myFilter, "cercano")

   Button4 OnStart :  Set(_myFilter, "atrasado")

 

So, this is where AddColumns is your friend.  As we did before, you would have an AddColumns formula that would provide the logic for each row that you can then filter against.

So, for example in your Gallery Items:

Filter(AddColumns(yourDataSourceOrFilter; "Estado"; If('% Avance'=100;"completado";DateDiff(Today();'Fecha Termino')<0;"atrasado";DateDiff(Today();'Fecha Termino')<=5;"cercano";"tiempo")); Estado=_myFilter)

Hope that gets you going.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

@FelipeCaru 

I was wondering what you had on your button OnSelect actions...

So, your OnSelect should be as stated before and then the Navigate formula.

   Set(_myFilter; "completado");; Navigate(....

 

I know you use ; for , (I've been trying to substitute for clarity for you - even though I miss a few).

I am pretty sure your combined statement separator is ;;  For me it is a single ;

 

As for the formula:

You just need to substitute in your dataSource and filter from the gallery.  I believe you've been using:

SortByColumns(Filter(demo_project; Título = ListaProyectos.Selected.Value && User().Email in ShowColumns(Encargado;"Email"));"Fecha_x0020_Termino";If(SortDescending1;Descending;Ascending))

 

You just need to substitute all this together like this:

SortByColumns(
Filter(
AddColumns(
Filter(demo_project; Título = ListaProyectos.Selected.Value && User().Email in ShowColumns(Encargado;"Email"));

"Estado"; //here we are adding a column to your result set
If('% Avance'=100;"completado";DateDiff(Today();'Fecha Termino')<0;"atrasado";DateDiff(Today();'Fecha Termino')<=5;"cercano";"tiempo")); //here we are setting the value of the Estado column
Estado=_myFilter) //and here we are applying the value in the _myFilter variable (from the button) to the Filter
;"Fecha_x0020_Termino";If(SortDescending1;Descending;Ascending)) //and here we are sorting by the termino column

Please remember as before, if you are going to use the Selected property for a Form somewhere (Galleryx.Selected) you will need to Drop that Estado column if you want to tie to to the DataSource demo_project. Otherwise, like before, you will get a error on it.

 

Hope that clears it up some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

10 REPLIES 10
Highlighted
Super User III
Super User III

@FelipeCaru 

 

For your DropDown you should have:

    Items: Distinct(Filter(demo_project;User().Email in ShowColumns(Encargado;"Email"));Título) (assuming this works for you)

    Value: Result

    Default: galleryListaProyecto.Selected.Title  (assuming the value is in Title - if not, change as needed)

 

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

Thank you a lot @RandyHayes !

That worked perfectly. The only thing I had missing from what you wrote was the "Default" category. What does it do, this one? To know for further info in case I need it again (which, considering, it is most likely)

Highlighted

@FelipeCaru 

Default is what a control "defaults" to.  You can use it to set an initial value of a control.  It is also the value that the control falls back to if you Reset the control.  Yes, you will use it often!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

Not sure if should open a new topic, so will ask here @RandyHayes .

 

With a button, it too would be in the default part?

I have this view, that will allow the user search according to status/days left (or symbol). The items that are there are static buttons, ie, wont change them since those are the defined categories.

boton1.png

 

So, say, if an user selected those with yellow triangle, in the gallery view (it is another gallery, not the same one I have used for project), I would have only those that are "yellow triangle".

boton2.png

To get the images, I have the code as following:

If(ThisItem.'% Avance'=100;okDate;DateDiff(Today();ThisItem.'Fecha Termino')<0;lateDate;DateDiff(Today();'Fecha Termino')<=5;closeDate;defaultDate)

So where should I put a filter? option? to make it so I only see one kind of "symbol"?

 

 

IF needed, I can throw this to a new thread instead of using this solved one.

Highlighted

@FelipeCaru 

This might be a quick answer, so not needed in another thread.

 

Let's start with the buttons - set the OnSelect action as follows (in the order I see in the photo):

   Button1 OnStart :  Set(_myFilter, "completado")

   Button2 OnStart :  Set(_myFilter, "tiempo")

   Button3 OnStart :  Set(_myFilter, "cercano")

   Button4 OnStart :  Set(_myFilter, "atrasado")

 

So, this is where AddColumns is your friend.  As we did before, you would have an AddColumns formula that would provide the logic for each row that you can then filter against.

So, for example in your Gallery Items:

Filter(AddColumns(yourDataSourceOrFilter; "Estado"; If('% Avance'=100;"completado";DateDiff(Today();'Fecha Termino')<0;"atrasado";DateDiff(Today();'Fecha Termino')<=5;"cercano";"tiempo")); Estado=_myFilter)

Hope that gets you going.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

A bit confused there.

Should I go to the screen where I have the 4 categories, and on the "onselect" of each button, write "Set(_myFilter, "completado")"? Asking since I didn't find in the available properties the "onStart", unless, it is somewhere else?

Highlighted

@FelipeCaru 

Yes, If I understood correctly...you have a screen with 4 buttons on it.  You want to have the user click on that button and filter your gallery based on that click.

If that assumption is correct, then yes, on the buttons set those OnSelect actions.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

How can I have 2 different on select though? On the button, since the first onSelect is a navigate to gallery. How can I add/make that filter then?

 

And, could you perhaps explain/break down the formula? Not sure what I am looking at @RandyHayes 

Highlighted

@FelipeCaru 

I was wondering what you had on your button OnSelect actions...

So, your OnSelect should be as stated before and then the Navigate formula.

   Set(_myFilter; "completado");; Navigate(....

 

I know you use ; for , (I've been trying to substitute for clarity for you - even though I miss a few).

I am pretty sure your combined statement separator is ;;  For me it is a single ;

 

As for the formula:

You just need to substitute in your dataSource and filter from the gallery.  I believe you've been using:

SortByColumns(Filter(demo_project; Título = ListaProyectos.Selected.Value && User().Email in ShowColumns(Encargado;"Email"));"Fecha_x0020_Termino";If(SortDescending1;Descending;Ascending))

 

You just need to substitute all this together like this:

SortByColumns(
Filter(
AddColumns(
Filter(demo_project; Título = ListaProyectos.Selected.Value && User().Email in ShowColumns(Encargado;"Email"));

"Estado"; //here we are adding a column to your result set
If('% Avance'=100;"completado";DateDiff(Today();'Fecha Termino')<0;"atrasado";DateDiff(Today();'Fecha Termino')<=5;"cercano";"tiempo")); //here we are setting the value of the Estado column
Estado=_myFilter) //and here we are applying the value in the _myFilter variable (from the button) to the Filter
;"Fecha_x0020_Termino";If(SortDescending1;Descending;Ascending)) //and here we are sorting by the termino column

Please remember as before, if you are going to use the Selected property for a Form somewhere (Galleryx.Selected) you will need to Drop that Estado column if you want to tie to to the DataSource demo_project. Otherwise, like before, you will get a error on it.

 

Hope that clears it up some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,897)