This repository contains a Power Apps Component Framework (PCF) component that allows us to capture coordintes of a location where user click or touches on an app screen and store them in its attributes 'XAxis' and 'YAxis'. This can be useful in scenarios where you need to track user interactions or gather data related to mouse clicks within your Power Apps.
- Download the Zip folder from this repository
- Unzip and open the folder
- Hit the following commands to build the component
- To install all dependencies
npm install
- To build the component
npm run build
- To start and preview the component in action
npm start
- Create a new folder and navigate into it
- Create new solutions project using the following command
pac solution init --publisher-name <> --publisher-prefix <>
- Now add refernce by locating the component (In our case: The root folder)
pac solution add-reference --path <>
- Now open up the visual studio in the same location of your created folder use the following command to package the component
msbuild /t:build
- Go to bin > Debug to have the packaged component
- Go to Power Apps
- Click on Import Solution and select the packaged folder
- Go to Insert and click on Get more components
- At the top, click on Code tab
- Select the component package you imported in prior step and Import
- Just Insert the component to your Canvas
- Adjust the size of the component you require
- Click anywhere on the components space to capture coordinates of the mouse click.
- You could access the values by setting up labels and set their Text attribute to PoCClickCoordinates1.XAxis and PoCClickCoordinates1.YAxis