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

Controlling Form with global variable

Hello,

 

When users log into my app they are given an access level (number between 1 and 5) which is Set to a global variable.

 

I've managed to use the Value function in the app to convert it into a number such that arguments like '>' work. However this does not seem to work on a form dismplay mode, see below:

 

displaymode.PNG

 

The error says: "The property expects Enum values, but this rule produces incompatible Text values".

 

My forumula:

 

If(Value(Access_level)>4,DisplayMode.Edit,
If(dropdown_user.Selected.Operator=DataCardValue15_1.Text,
    FormMode.Edit,
    FormMode.View))

 

I'm not sure if this is a bug or if I am doing something stupid, please can you help?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate IV
Advocate IV

Re: Controlling Form with global variable

Big apologies! I'd been staring at it for too long and missed a very silly mistake!!

 

I was using display mode instead of form mode in the first line of the forumla, it should read:

 

If(Value(Access_level)>3,FormMode.Edit,
If(dropdown_user.Selected.Operator=DataCardValue15_1.Text,
FormMode.Edit,
FormMode.View))

 

View solution in original post

1 REPLY 1
Highlighted
Advocate IV
Advocate IV

Re: Controlling Form with global variable

Big apologies! I'd been staring at it for too long and missed a very silly mistake!!

 

I was using display mode instead of form mode in the first line of the forumla, it should read:

 

If(Value(Access_level)>3,FormMode.Edit,
If(dropdown_user.Selected.Operator=DataCardValue15_1.Text,
FormMode.Edit,
FormMode.View))

 

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,564)