cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fa1con74
Helper III
Helper III

Display according to tab

Hello,
I want in a screen to display a gallery with all my registration on a tab called "all agents" and in another tab to display only the information of the logged in user in a display form that can be displayed in modofiable if click on a button.

 

I put this code in onstart

 

ClearCollect(
    colTabs;
        {
            Title: "All Agents";
            ID: 1;
            Logo: Icon.Tag
        };
        {
             Title: "My Infos";
            ID: 2;
            Logo: Icon.LogJournal
        }
);;
Set(
    varTabSelected;
    1
)

 

My "HomeScreen" screen "onvisible"

 

UpdateContext({CurrentUser:User().Email});;UpdateContext({locTab:1})

 

Fa1con74_0-1647334759518.png

Fa1con74_1-1647334805726.png

Item from my gallery "galHome_1" 

 

If(
    varTabSelected = 1;
    Filter(
            BdMs_New;
            StartsWith(
                Nom;
                txtNom_1.Text
            ) && (Sdis.Value = RadioSdis.Selected.Value || RadioSdis.Selected.Value = Blank())
            && ((CheckMe.Value && 'Email pro' = CurrentUser) || CheckMe.Value = false)
            && ((CheckUV.Value && "yes" in ForAll(cbUV.SelectedItems;If(Value in 'UV Pompiers'.Value;"yes";"no"))) || CheckUV.Value = false)
            && ((CheckFonction.Value && "yes" in ForAll(cbFonction.SelectedItems;If(Value in 'Fonction Musar'.Value;"yes";"no"))) || CheckFonction.Value = false)
        );
    Filter(
    BdMs_New;
    'Email pro' = CurrentUser)
    )

 

I don't see how to make my form display the information of the logged in user

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Fa1con74 
You don't need to add anything visible, that should filter the users and show only what they created 
What is Email pro field type secondly add this onStart make it global variable by doing this 

 

Set(CurrentUser,User().Email)

 

Run it and tested, let me know 

 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

View solution in original post

8 REPLIES 8
Ramole
Super User
Super User

Hi @Fa1con74 
Have look this video explained by @RezaDorrani here the link  you can also download the sample and see how how he made it

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
ansrikanth
Resolver III
Resolver III

Hi @Fa1con74 

On your GalTabs, use the even on Select.. Check condition if the selcted tab value is 1 or 2 based on that you have to either hide your GalAllAgents or your Edit form.

 

When it comes to display the information of the user on a form, follow this link Power Apps Guide - Forms - How to show Office 365 user profile details on a form - Power Apps Guide ...

 

This should help, if not, let us know what exactly is the problem you are facing..

 

thank you

-Srikanth

Fa1con74
Helper III
Helper III

Thank you, I understood how to make my tabs, however, I don't understand how to make my filter to display only the logged in user's file

Have you tried the first or second option from this blog post ?? http://powerappsguide.com/blog/post/show-office-365-profile-detail-in-form 

 

Thank you

-Srikanth

I expressed myself badly, I want only the connected user's file to be displayed and not the office user profile

Ramole
Super User
Super User

@Fa1con74 
Lets do basics add a gallery on screen and on items property add this code and tell me what you see?

Filter(
    BdMs_New;
    'Created By'.Email = User().Email)

I believe your in Europe correct ? you will need to use   ; instead , 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

Thanks, I modified your solution, but it doesn't work.

Filter(
    BdMs_New;
    'Email pro' = CurrentUser)

In my database there is an 'Email pro' field and in the visible part of my screen I put

UpdateContext({CurrentUser:User().Email});;UpdateContext({locTab:1})

I don't understand why it doesn't work

@Fa1con74 
You don't need to add anything visible, that should filter the users and show only what they created 
What is Email pro field type secondly add this onStart make it global variable by doing this 

 

Set(CurrentUser,User().Email)

 

Run it and tested, let me know 

 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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