cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
3csman
Impactful Individual
Impactful Individual

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
priyeshwagh777
Advocate IV
Advocate IV

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,933)