Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

power apps component framework , type script

Hi, I am new to power apps component framework and typescript. I am trying to create a button in type script and add the click listener to the button. I could manage to create a button by calling document.create Element("button");


1. Could you please help me about how should i add a click listener to the button. 

Also, i could see the button in the web page

2. When i import that component in power apps, i could not see the button in power apps, I am not sure what i am doing wrong. 

I am sure that i am importing it correct, because i tried to create a sample components  from the Microsoft documentation, i could see the TS Linear Input Component in the web page, also in power apps.

Please could some one assist me

Thanks in Advance


When you open / play the application you are trying to attach the PCF component to the url is the bit below in the browser.




In the screenshot above is my sandbox instance for one of the things we are working on - as with you won't be able to connect to it as that is another of my development instances.


For reference - the url of a Dynamics or model driven power app is in 2 bits.


your instance name . crm / azure region followed by 


you need to know your organization name I'm guessing its'  metamicro123 and the number for the crm region metamicro123 is in (as it is clearly not in region  11 which is the UK) so the url will be something like https://metamicro123.crm? where the ? is the number for the azure region your instance is in. 


If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Thank you very much for the reply. you are correct about this, and i managed to get the URL and created the authentication profile.

Now i am trying to use the command pac pcf push --publisher-prefix dev and i am getting the following errors. I do see the zip file named powerAppsTools_dev in the path C:\Users\vani\Documents\RetrieveQuestionComponent\obj\PowerAppsTools_dev\bin\Debug.

But i dont see the powerAppsTools_dev in power apps.


Error: Import Solution Failed: CustomControl with name QuestionNamespace.RetrieveQuestionInputComponent failed to import with error: CustomControls with Name QuestionNamespace.RetrieveQuestionInputComponent Import Solution Failed with following error: The forceupdate flag for the control QuestionNamespace.RetrieveQuestionInputComponent is set to true but the control version in the solution is less than the control version in CDS. Please make sure the versions are atleast equal.


Please could you advise,

 i am new to the PCF and learning. 

The quickest way to fix that is to:-


login to Dynamics and


remove the custom control from the page it is on (just open the field and delete it).

publish the page

delete the existing version of the control


then publish the control from the command line


and add it to the control it was attached to before.


I'm sure someone else will come along with the actual solution but I encountered the same issue when I moved from using the build and import approach to the push approach and I didn't have time to wait for an answer.


If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Hi @ben-thompson 

The issue is due to incrementing the control version and using push.  For now the workaround is to not increment the control version and push, or do as you suggested and remove and re-add the solution.  There has already been a fix checked in on the code side to fix the root cause of the issue, but it hasn't made it to all the way down to all regions yet.  It will hopefully be available in the NA region at the end of this week though.

Helpful resources

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,054)