cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Super User
Super User

Multiple If or Switch to display the data in text boxes

my dental app has a attached screen. On clicking the image, the background color changes. Now i want to show in the text boxes which image boxes are clicked.

 

Example under Restoration the tooth list which selected should come (based on the image box Fill color), ABF, likewise Root canal : C, 'Restoration: T

 

Please help as i badly need help on this is to complete. I tried some nested if statement but they are not working .

 

Example, on Apply diagnosis button click : If(im_at.Fill = Red, Set(rest_at,"A"),If(im_at.Fill = Yellow, Set(root_at,"A"),If(im_at.Fill = Black,Set(extr_at,"A"),
If(im_bt.Fill = Red, Set(rest_bt,"B"),If(im_bt.Fill = Yellow, Set(root_bt,"B"),If(im_bt.Fill = Black,Set(extr_bt,"B")))))));

 

and in the text property of Restroration input giving this as rest_at & rest_bt & rest_ct

text property of Root canel input giving this as root_at & root_bt & root_ct

 

in this way this will be easy for me to store the values of text input in sharepoint list.

But unfortunately i do not know where i am going i am not getting the desired result.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@venka91 

So as a little example.  I took what you showed in the image and the explanation you gave as to what you are trying to do and threw this into a little app.  There really is only one formula in the entire app and three little ones for the three text input boxes.  Total controls - 13 (including the labels and text controls,etc.) Total variables - 0.  Total collections - 1.  

 

Looks like this:

EDIT: Having problems getting the image attached...trying in separate post.

 

The app is attached if you would like it.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

16 REPLIES 16
RandyHayes
Super User
Super User

@venka91 

Can you please describe further the list of images?  Is this a Gallery of individual images or are these individual images you have put on a screen?  

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

They are not gallery . All are individual images 

RandyHayes
Super User
Super User

@venka91 

This approach would be much easier with a Gallery, but if for some reason that is not possible, how are you then selecting an image?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hey 

 

Onselect event of each image box I made the  switch statement that changes its fill color and it's label.

 

So when images are selected with click it will change as per diagnosis as restoration, root canal or extraction with red, yellow and black respectively.

 

I also used gallery with the help from community member , but unfortunately i do not how to pass the gallery results to SharePoint as gallery is getting generated dynamically based on the images selected.

 

RandyHayes
Super User
Super User

@venka91 

This will be highly manual and repetitive to do this with individual images, labels, etc.  You will end up doing a lot of work and variables and OnSelects and more, whereas with a Gallery, you'll have a couple of formulas and be done.

 

So, if you need assistance getting this into a Gallery, I'd be more than happy to provide assistance with that.  

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Sure I need either or anyone of the way to get it completed.

 

This is the another thread I posted and waiting for the helping hand.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Store-gallery-results-to-Sharepoint/m-p/8746...

 

RandyHayes
Super User
Super User

@venka91 

So as a little example.  I took what you showed in the image and the explanation you gave as to what you are trying to do and threw this into a little app.  There really is only one formula in the entire app and three little ones for the three text input boxes.  Total controls - 13 (including the labels and text controls,etc.) Total variables - 0.  Total collections - 1.  

 

Looks like this:

EDIT: Having problems getting the image attached...trying in separate post.

 

The app is attached if you would like it.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RandyHayes
Super User
Super User

@venka91 

Having problems today with inserting images into the forum posts.  So I have attached the animation of the app.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks a lot for this effort. The part which I am struggling after you show the tooth labels into the result how to pass them to SharePoint list. Are these again gallery or text boxes.

 

I have 3 columns in SharePoint list as Restoration, Root canal and extraction. But how I do I patch my list with the values shown if this is gallery .

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,964)