cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Partisan
Post Partisan

Variables and Condition Statements

I have:

 

1. Power Apps Screens

2. An SP Member list
3. The Member list has columns like 'UnqID'(Text), UserName(Text), Hierarchy(Text)

4. An SP Member Training List

5. The SP Member Training List has specific information about the member (including the UnqID) and has columns that mimic those in the Member list

4. Several Screens have Dropdowns, Combo Boxes, Galleries, and Forms

 

I need a multiple condition formula that I can paste into various 'default', 'item', etc. properties in such a way that whoever the User is the system can identify them and apply appropriate levels of access through the Dropdowns/Combo Boxes, and display only specific data in Galleries based on the Member hierarchy designation.

 

The Member List Hierarchy column can contain 'Employee', 'Park', 'Region', and 'National' designations.

 

What I need is a multiple condition or multiple variables that can placed in various places in the App that recognize the User and their Hierarchy designation (as determined by the Hierarchy column in the Member List), and apply the appropriate access to Dropdowns, Combo Boxes, and display only specific data based on said Hierarchy designation.

 

I currently have a 'Park' Dropdown that has the following:

In Default: blank (no content)

In DefaultSelectedItems:  Filter(SortByColumns(ParkListCollection.Park, "Title", Ascending), Title = ParkDD.Selected.Park)

In Items: ParkListCollection

In DisplayMode: If(varIsNational,DisplayMode.Edit,DisplayMode.Disabled)

 

My varIsNational variable is: 

Set(varIsNational,If(User().FullName="          ",true,User().FullName="             ", true,,User().FullName="             ",true,false));

 

I did the above for eight names. There are now too many names to work a reliable variable this way. How can I create a variable that looks to the Member List Hierarchy column and asks 'if Member hierarchy is...', then...whatever access the Member needs/should have should be enforced.

1 REPLY 1
Highlighted
Advocate II
Advocate II

See if this thread helps - 

https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-use-IF-condition-in-PowerApps/td-p/37...

 

I had reviewed some dependent drop downs in the past which is in CDS context, but you can apply in your use case - https://d365demystified.com/2020/07/01/dependent-optionsets-in-a-canvas-power-app-for-1n-related-cds...

 

And for Variables in Power Apps, try using this and using the same name to update the variable declared once - https://d365demystified.com/2020/05/19/variables-in-canvas-power-apps-global-and-context/

 

Hope this helps! 

 

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 (7,714)