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

Access icon properties using SharePoint value (same as the icon name)

So, I'm building an desk reservation application. The requirement is to create a dynamic pin-point, to the desk which is selected, on the jpeg Floorplan.

I'm trying to set the value of that icons to true/false depending on what the value from SharePoint is available.

I'm planning to do this by setting the value of a global variable to the value of "pinNameForApp" which is pulled from the SharePoint. This value is exactly same to the name of that icon.

Say the name of icon is 'pinLW19', that value would be set for the global variable. 

 

Now I want to access this icon (of name pinLW19) and set it's Visible property to "true".

Is there a way to find the icon by its name, or access it some other way?

Attaching images for the icon, image and screen and for the SharePoint data. 

4 REPLIES 4
WarrenBelz
Super User III
Super User III

Hi @imdsrs ,

You cannot refer to Power Apps objects dynamically, however in your case, there may be a solution. If for instance you set varButton as a string as pinLW19, using a Lookup to the SP list

UpdateContext(
   {
      varButton:
      LookUp(
         deskDetails,
         WhateverYourMatchIs
      ).pinNameForApp
   }
)

then the Visible property of this icon would be

varButton="pinLW19"

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks for the review and your comment.

But there are multiple (~300) icons on the Floorplan. All would be false by default; the one whose name/value is fetched from the SP would turn True.

How do a set a generic variable on each of the Icon's 'Visible'? 

@imdsrs ,

Exactly as I suggested - a statement that can only be true or false can be reflected directly in a control property that is also Boolean, so instead of 

If(
   varButton="pinLW19",
   true,
   false
)

you can just put

varButton="pinLW19"

Just set the variable to the Lookup value and you will need to put the relevant name on each of the Icon's Visible properties.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @imdsrs ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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.

Top Solution Authors
Top Kudoed Authors
Users online (31,801)