cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Patron
Post Patron

Change Color Based on Condition

Hello,

 

I'm trying to apply Conditional Color formatting. 

 

I have a Flag icon and want to change its color based on changes in the database. Below is the Business Process. 

 

User1: Creates the record and submits it to the database and User2 sees this record with a Yellow flag.

User2: This user has a checkbox to mark every record as processed and flag color changes to green.

 

Problem: If user2 marks the record as processed. and User 1 makes any changes to the processed record, then User2 should see this changed record as a Yellow color flag and mark it as not processed.

 

Any suggestions? 

 

Thanks,

Omi

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @omi18 ,

 

You could try to create a column in your data source.

When user 1 creates a record, the value of this column is automatically filled with false.

When user 2 uses the check box to select, the value is updated from false to true.

If user 1 goes to modify the record after this, the value is given to false again.

So, if the value is false, the color of the icon is yellow, otherwise the color of the icon is green.

 

I did a simple test for you.  My test datasourse is sharepoint list 'LIST111'. 'Test' is a 'Single line of text' column.

v-xiaochen-msft_0-1618456792727.png

1\ Add a gallery control 'Gallery3' and set its Items property to:

LIST111

 

Insert a Checkbox control and set its Default property to:

If(ThisItem.Test="true",true,false)

 

Set the Checkbox control's OnCheck property to:

Patch(LIST111,ThisItem,{Test:"true"});Refresh(LIST111);Reset(Checkbox1)

 

Set the Checkbox control's OnUncheck property to:

Patch(LIST111,ThisItem,{Test:"false"});Refresh(LIST111);Reset(Checkbox1)

 

Insert an Icon and set its Color property to:

If(ThisItem.Test="true",Green,Yellow)

 

2\ Add an edit form control 'Form1' and set its DataSource property to:

LIST111

 

Set the form's Item property to:

Gallery3.Selected

 

3\ Add an Icon control and set its onselect property to:

NewForm(Form1)

 

4\ Add an Icon control and set its onselect property to:

SubmitForm(Form1);Patch(LIST111,Form1.LastSubmit,{Test:"false"})

 

5\ Set 'Gallery3' 's OnSelect property to:

EditForm(Form1)

 

6\ The result is as follows:

AAA.gif

 

In additon, If you want user 1 to be invisible to the check box control, you could set the visible property of the check box control .

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @omi18 ,

 

You could try to create a column in your data source.

When user 1 creates a record, the value of this column is automatically filled with false.

When user 2 uses the check box to select, the value is updated from false to true.

If user 1 goes to modify the record after this, the value is given to false again.

So, if the value is false, the color of the icon is yellow, otherwise the color of the icon is green.

 

I did a simple test for you.  My test datasourse is sharepoint list 'LIST111'. 'Test' is a 'Single line of text' column.

v-xiaochen-msft_0-1618456792727.png

1\ Add a gallery control 'Gallery3' and set its Items property to:

LIST111

 

Insert a Checkbox control and set its Default property to:

If(ThisItem.Test="true",true,false)

 

Set the Checkbox control's OnCheck property to:

Patch(LIST111,ThisItem,{Test:"true"});Refresh(LIST111);Reset(Checkbox1)

 

Set the Checkbox control's OnUncheck property to:

Patch(LIST111,ThisItem,{Test:"false"});Refresh(LIST111);Reset(Checkbox1)

 

Insert an Icon and set its Color property to:

If(ThisItem.Test="true",Green,Yellow)

 

2\ Add an edit form control 'Form1' and set its DataSource property to:

LIST111

 

Set the form's Item property to:

Gallery3.Selected

 

3\ Add an Icon control and set its onselect property to:

NewForm(Form1)

 

4\ Add an Icon control and set its onselect property to:

SubmitForm(Form1);Patch(LIST111,Form1.LastSubmit,{Test:"false"})

 

5\ Set 'Gallery3' 's OnSelect property to:

EditForm(Form1)

 

6\ The result is as follows:

AAA.gif

 

In additon, If you want user 1 to be invisible to the check box control, you could set the visible property of the check box control .

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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

Top Solution Authors
Top Kudoed Authors
Users online (63,663)