cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerNapper
New Member

PowerApps Best Practise for Implementing workflow

What is the best practise/more efficient in terms of updating field properties within Canvas Apps. Using one formula (from one property) to alter two different field properties or have two different fields with two different properties to implement the change

e.g.

I have two fields A & B. the OnChange property of A could be used to patch a record and then an If statement could run to assess the value and change the Display property of field B accordingly (Patch and If statement within OnChange of field A); or Field A OnChange could Patch the record and the If statement could reside within the Display property of field B (Field A OnChange Patch, Field B Display propery If Statement). Which is better?

1 ACCEPTED SOLUTION

Accepted Solutions
KvB1
Solution Specialist
Solution Specialist

How would you change the display property of B using an if statement in field A? You would need to set a variable, and then use that variable on the relevant property of field B. You would save yourself a variable if you just have the display property for B reside in B.

View solution in original post

4 REPLIES 4
KvB1
Solution Specialist
Solution Specialist

How would you change the display property of B using an if statement in field A? You would need to set a variable, and then use that variable on the relevant property of field B. You would save yourself a variable if you just have the display property for B reside in B.

View solution in original post

CreativeSCot
Regular Visitor

In the situation below you have two fields within a gallery item with data source="DataSource" 
Field A is a dropdown and field B is a text input which can variably change display state based off the column decision (Field A allows selection of the decision).

Option1
OnChange Property of Field A :


Patch(DataSource,ThisItem,{'Decision':FieldA.Selected.Value});

If(ThisItem.'Decision'<>[@'Decision Choices'].Successful,

FieldB.DisplayMode=DisplayMode.View, FieldB.DisplayMode=DisplayMode.Edit

)

 

Vs

Option 2

 

OnChange Property of Field A :


Patch(DataSource,ThisItem,{'Decision':FieldA.Selected.Value});

 

Display Property of Field B:

If(ThisItem.'Decision'<>[@'Decision Choices'].Successful, DisplayMode.View, DisplayMode.Edit

)

You make a good point..... Silly question. Option 1 doesn't work. 

KvB1
Solution Specialist
Solution Specialist

Working with variables can also be smart, for example if you can set them to true or false depending on the text property of an input field.

 

That way you can also reuse them for If statements, visibility etc

 

For just one control it seems wasteful

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,903)