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

Fill color of Box with three different colors in background

Dear All, i am developing a dental application. I have teeth pictures placed on the box. Based on the dental examination, the box needs to be marked with different colors. Example, if teeth requires restoration, color is yellow. If teeth requires root canal then Red, if teeth requires restoration then black.

 

Could any one pls help. I have got a screen as attached. I am using image box load the teeth pic, and filling the background color of the control. i need something similar to this. How do i do and i am running out of ideas.  Because for the 20 individual teeth, the color needs to be done based on the diagnosis. Please help.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

hi @venka91 

 

Question 1.

It will be best to do this collection in the OnStart property of the app (you only need to load this once). Now there is a few ways to go about getting to work with multiple images on a canvas app but since we started with a collection lets continue and you can try out a component by yourself as another way.

 

Question 2.

Add all your images to media section. I will add three images (mine are svg from the web), tooth-dental-svgrepo-com, tooth-shape-outline-svgrepo-com, and tooth-svgrepo-com  

rubin_boer_0-1616919181024.png

Now the collection as per Question 1 (I will only add the three images)

OnStart = ClearCollect(colDental,ForAll(Sequence(3),{toothnumber: Value, diagnosis:"none", img:

Switch(true ,
Value=1,'tooth-dental-svgrepo-com',
Value=2,'tooth-shape-outline-svgrepo-com',
Value=3,'tooth-svgrepo-com')

)

At this point the collection have all three images in it not, just one like before. Here you will have to expand the switch command to include all your images.

 

Here is the gallery with all the teeth in the collection.

rubin_boer_1-1616919570889.png

your Switch will have all the numbers from value 4 to value 20

 

Question 3.

Add another gallery and set its Items = AddColumns(GroupBy(Filter(colDental,diagnosis <> "none"),"diagnosis","Summary"),"Teeth",Summary.toothnumber)

 

Add two label to it

label 1 Text = ThisItem.diagnosis

label 2 Text = Concat(ThisItem.Summary,Char(toothnumber+64),", ")

label 2 Fill = Switch(true,
ThisItem.diagnosis = "Extraction", Black,
ThisItem.diagnosis = "Restoration", Red,
ThisItem.diagnosis = "Root Canal", Yellow,
RGBA(237, 237, 237, 1))

make sure the text can be read by changing the color of the text

Label 2 Color = Switch(true,
ThisItem.diagnosis = "Extraction", White,
ThisItem.diagnosis = "Restoration", Black,
ThisItem.diagnosis = "Root Canal", Black,
RGBA(237, 237, 237, 1))

Result:

rubin_boer_2-1616921071855.png

 

Hope this sets you on your way. 

 

 

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

venka91
Impactful Individual
Impactful Individual

Thank you. I made a collection at the start of app and loaded all images to media section. But when i go and view my collection, i do not see the images included there. Also in gallery i am not able to see the uploaded image. Where i am making mistake? no idea.

 

Is that possible can you export the app and give it to me someway, i will go through and see where i am doing mistake and also will help me to learn.

 

 

View solution in original post

9 REPLIES 9
venka91
Impactful Individual
Impactful Individual

Dear All, i managed to make three different colors when the box is clicked with the below code.

UpdateContext({x: x+1});
Switch(x,1,UpdateContext({col:Red}),2,UpdateContext({col: Yellow}),3,UpdateContext({col: Black}),4,UpdateContext({x:0}))

 

and now i have another requirement and seeking your help.

 

I have 20 boxes. I have given them label as A, B, C, D., etc. User click on box and select the color based on the dental diagnosis made. Example : Red for Restoration, Yellow for Root Canal, Black for Extraction.

 

Now i would like to show which box is selected on my Diagnosis Summary.

 

I have 3 labels given on my Summary Screen.

Extraction: (i want to show which boxes are selected based on black color)

Root Canal: (i want to show which boxes are selected based on Red canal)

Restoration: (i want to show which boxes are selected based on Yellow color)

 

Pls team help i badly need the logic and help.

Hi @venka91 ,

 

You just need to upload to SharePoint list and open it to gallery, then you can now update the status which is connected to the colors.

SharePoint List consist columns 
links of image, status, id

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

venka91
Impactful Individual
Impactful Individual

it looks you have some idea. can you please little explain about that. i am really blank and scratching my head to find solution.

hi @venka91 see if this will help you in addition before you save your data.

 

Add your images to the app if not already and show the in a gallery. as you need 20 images lets create a collection with twenty items. i included the image name, tooth number and diagnosis in the collection

 

ClearCollect(colDental,ForAll(Sequence(20),{toothnumber:Value, diagnosis:"none", img:toothache_50px}))

 

With the gallery's word wrap set to two i get two rows and 10 columns as below. add the image and a label to the gallery.

 

rubin_boer_0-1616873517411.png

 

Click the image and set the Fill = Switch(true,
ThisItem.diagnosis = "Extraction", Black,
ThisItem.diagnosis = "Restoration", Red,
ThisItem.diagnosis = "Root Canal", Yellow,
RGBA(237, 237, 237, 1))

 

Add two labels to the app, outside of the gallery and call setthe text to:

label1 Text = "Selected Tooth: " & Char(YourGallery.Selected.toothnumber + 64) 

rubin_boer_3-1616873840443.png

 

label2 Text = "Select diagnosis"

rubin_boer_2-1616873821638.png

 

 Add a dropdown and set its Items = ["Extraction","Root Canal","Restoration"]

rubin_boer_1-1616873805025.png

 

now when you click on a tooth, the label 1 will indicate which tooth you are selecting. Set the templatefile of the gallery to If(Self.IsSelected, WhiteSmoke, RGBA(0, 0, 0, 0)), this will show the user which tooth is selected additionally.

 

All of this will get you the following screen

rubin_boer_4-1616874034987.png

 

Add the button and call it Apply diagnosis, when the user click this patch the collection according, Patch(colDental,Gallery23.Selected,{diagnosis:Dropdown5.SelectedText.Value}). lets diagnose three teeth , teeth A, I and P and give them all a different diagnosis.

 

The user can see which tooth is having which diagnosis

rubin_boer_5-1616874186516.png

 

Is thi swhat you are looking for?

 

 

 

 

 

 

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Thank a lot for taking time to write this code and tested. But not to trouble you further more, but still i need a helping hand.

I am not clear where to define the collection : ClearCollect(colDental,ForAll(Sequence(20),{toothnumber:Value, diagnosis:"none", img:AT});

 

1. Should i be giving this on screen onvisible ? or at the Gallery

2. I have different images to upload. But when i select the image property and apply an image, Gallery is reflecting the same image to all rows.

3.And after applying diagnosis, i have the screen as below and show the Diagnosis summary. Is that doable. i am attached image.

 

Kindly help. I have only you as the source to get this completed.

hi @venka91 

 

Question 1.

It will be best to do this collection in the OnStart property of the app (you only need to load this once). Now there is a few ways to go about getting to work with multiple images on a canvas app but since we started with a collection lets continue and you can try out a component by yourself as another way.

 

Question 2.

Add all your images to media section. I will add three images (mine are svg from the web), tooth-dental-svgrepo-com, tooth-shape-outline-svgrepo-com, and tooth-svgrepo-com  

rubin_boer_0-1616919181024.png

Now the collection as per Question 1 (I will only add the three images)

OnStart = ClearCollect(colDental,ForAll(Sequence(3),{toothnumber: Value, diagnosis:"none", img:

Switch(true ,
Value=1,'tooth-dental-svgrepo-com',
Value=2,'tooth-shape-outline-svgrepo-com',
Value=3,'tooth-svgrepo-com')

)

At this point the collection have all three images in it not, just one like before. Here you will have to expand the switch command to include all your images.

 

Here is the gallery with all the teeth in the collection.

rubin_boer_1-1616919570889.png

your Switch will have all the numbers from value 4 to value 20

 

Question 3.

Add another gallery and set its Items = AddColumns(GroupBy(Filter(colDental,diagnosis <> "none"),"diagnosis","Summary"),"Teeth",Summary.toothnumber)

 

Add two label to it

label 1 Text = ThisItem.diagnosis

label 2 Text = Concat(ThisItem.Summary,Char(toothnumber+64),", ")

label 2 Fill = Switch(true,
ThisItem.diagnosis = "Extraction", Black,
ThisItem.diagnosis = "Restoration", Red,
ThisItem.diagnosis = "Root Canal", Yellow,
RGBA(237, 237, 237, 1))

make sure the text can be read by changing the color of the text

Label 2 Color = Switch(true,
ThisItem.diagnosis = "Extraction", White,
ThisItem.diagnosis = "Restoration", Black,
ThisItem.diagnosis = "Root Canal", Black,
RGBA(237, 237, 237, 1))

Result:

rubin_boer_2-1616921071855.png

 

Hope this sets you on your way. 

 

 

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
venka91
Impactful Individual
Impactful Individual

Thank you. I made a collection at the start of app and loaded all images to media section. But when i go and view my collection, i do not see the images included there. Also in gallery i am not able to see the uploaded image. Where i am making mistake? no idea.

 

Is that possible can you export the app and give it to me someway, i will go through and see where i am doing mistake and also will help me to learn.

 

 

Sorry, this worked perfectly as i need to close and open the app to get the collection refreshed.

 

You are my Life savior...  Millions of thanks to you. I am sure want to donate you something if you have Paypal account. Thanks a lot.

Last but not least, now i would like to store the result to share point list. I have not done with the gallery items as they are dynamic.

 

Example i have 3 columns in share point as "Extraction", "Root Canal" and " Restoration".

Whatever comes with the teeth label results comes in as per the above selection needs to be stored in Sharepoint list. Please help.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (650)