Hi Guys,
I'm not able to use variables with the Set () function that were assigned within the components that are inserted in some screens. Does the Set () function not work within components ??
Solved! Go to Solution.
Hi @Danilo-ES-BR ,
Could you please share a bit more about your scenario?
Do you want to reference the variable set within your Component within your app screen (outside the Component)?
Currently, within PowerApps, you could set up a global variable within the custom component. But the variable is scoped to component itself rather than whole canvas app.
Please check the following known limits with custom component in PowerApps:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#known-limitations
If you want to reference the global variable set up inside your custom component within your app screen (outside the Component), you consider add a Output property within your custom component, then bind the Output property with the global variable within your custom component.
After that, within your app screen, you could reference the global variable through the Output property of the custom component. I have made a test on my side, please take a try with the following workaround:
After that, you could reference the global variable within your app screen through the Component Output property. Within your app screen, you could use the following formula to reference the Output property of the custom component:
CustomComponentControlName.OutputProperty
More details about the custom properties in custom component, please check the following article:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#custom-properties
Best regards,
@Danilo-ES-BR
You can use variables inside components. But those SET variables should only be used inside the component and not referenced outside the component. Create a new output property if you need the component to communicate something to the outside world.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi @Danilo-ES-BR ,
Could you please share a bit more about your scenario?
Do you want to reference the variable set within your Component within your app screen (outside the Component)?
Currently, within PowerApps, you could set up a global variable within the custom component. But the variable is scoped to component itself rather than whole canvas app.
Please check the following known limits with custom component in PowerApps:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#known-limitations
If you want to reference the global variable set up inside your custom component within your app screen (outside the Component), you consider add a Output property within your custom component, then bind the Output property with the global variable within your custom component.
After that, within your app screen, you could reference the global variable through the Output property of the custom component. I have made a test on my side, please take a try with the following workaround:
After that, you could reference the global variable within your app screen through the Component Output property. Within your app screen, you could use the following formula to reference the Output property of the custom component:
CustomComponentControlName.OutputProperty
More details about the custom properties in custom component, please check the following article:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#custom-properties
Best regards,
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
205 | |
187 | |
77 | |
49 | |
37 |
User | Count |
---|---|
318 | |
262 | |
122 | |
73 | |
60 |