cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lalit_Kadam
Helper III
Helper III

"Two options" data type use in power app for CDS connectors

Hi,

 

I have created one chemical entity and one Isflamable column with "Two options"  data type in CDS for canvas app. I am trying reading IsFlamable column on Image control's  Image property. if  Isflamable value is "No" then load 'Flamable_image' image on image control in canvas app. but it is not working.

 

Using below code on Image property of image control.

 

If('FlamableColumn (Chemical)'.No,Flammable_Image)

 

Error:- you don't have permission to view this data.

 

But when I use "'FlamableColumn (Chemical)'.No" on text box control's text property and it is working.

 

Here I want to know how can I compare Two options data type's column value with if function and want to update this column on button click. Please suggest.

 

Regards,

Lalit Kadam

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Lalit_Kadam ,

Could you please share a bit more about the error message within your app?

Could you please show more details about the Flammable_Image that you mentioned? Is it a image data uploaded through the Media option in your app?

Further, do you display the image within a Gallery control?

 

If you display the image within a Gallery control, I think there is something wrong with the formula typed within the Image property of the Image control.

 

Please set the Image property of the Image control within the Gallery to following:

If(
   ThisItem.FlamableColumn = 'FlamableColumn (Chemical)'.No,
   Flammable_Image,
   SampleImage
)

Note: I assume that the Flammable_Image that you mentioned represents the image data uploaded through the Media option in your app rather than Image field in your CDS Entity.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

This isn't exactly an answer but for what it's worth, I've had much better luck using normal option sets even when I only have 2 options. Just define your options, Flammable, NotFlammable. Then you can call the values with [@optionsetname].Flammable or [@optionsetname].NotFlammable.

 

Just seems to work easier for me. 

v-xida-msft
Community Support
Community Support

Hi @Lalit_Kadam ,

Could you please share a bit more about the error message within your app?

Could you please show more details about the Flammable_Image that you mentioned? Is it a image data uploaded through the Media option in your app?

Further, do you display the image within a Gallery control?

 

If you display the image within a Gallery control, I think there is something wrong with the formula typed within the Image property of the Image control.

 

Please set the Image property of the Image control within the Gallery to following:

If(
   ThisItem.FlamableColumn = 'FlamableColumn (Chemical)'.No,
   Flammable_Image,
   SampleImage
)

Note: I assume that the Flammable_Image that you mentioned represents the image data uploaded through the Media option in your app rather than Image field in your CDS Entity.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,898)