cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
takashi9999
Helper II
Helper II

PowerApp set the tracking for when people click into the pic

Hello All

 

I created sharepoint and put the photo inside which can allow people click from powerapp to view the image. the question 1: (how we can set the tracking for when people click into the pic, it auto count +1 view into sharepoint (CountOfView) for this image? because I would like to monitor those photos for which one people like. Please guide me how to to it. Many Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @takashi9999 :

I assume ClickOfView is a number column and WhoClickThis is a sinlge line of test column.

Please try:

Set the gallery's OnSelelct Property to:

Patch(
  Documents,
  ThisItem,
  {
    ClickOfView:ThisItem.ClickOfView+1,
    WhoClickThis:
        If(
            User().FullName in Split(ThisItem.WhoClickThis,";"),
            ThisItem.WhoClickThis,
            IsBlank(ThisItem.WhoClickThis),
            User().FullName,
            ThisItem.WhoClickThis&";"&User().FullName
        )
   }
)

vbofengmsft_0-1631856273493.png

Best Regards,

Bof

 

View solution in original post

7 REPLIES 7
Ashwin7104
Responsive Resident
Responsive Resident

Hey @takashi9999 - How about we use SharePoint's built-in Likes column to determine whether or not the user liked (clicked) the image. And I'm assuming that a person can only like the picture once. If so, you can update the "LikedBy" column in SharePoint column to keep track of number of likes and who liked it.

for this powerapp function we need to count how many time the user click into photo, for example if photo A user click into it 10 times, B photo 8 time and C photo 5 time, those record will store into sharepoint, if possible we may need to include the date for clicking the photo. not sure as your suggestion may not able to do this

rampprakash
Memorable Member
Memorable Member

Hi @takashi9999,

 

Hope the Image is maintained in a List.

 

Create field in the List as ImageCount (Whole number)

 

Hope the image is in Gallery level so that they can see all the image form the List 

 

Then On select of Image 

 

Set(getSelectedLisyValues, Filter(ListName, ID=ThisItem.ID ))

Update(ListName,First(Filter(ListName,ID=ThisItem.Id)), { ID: ThisItem.ID, ImageCount=getSelectedLisyValues.ImageCount+1 } )

 

Please mark as Answer if it is helpful and provide Kudos

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

I have put the code u provided, but some of link may have issue. please advise

@takashi9999 - Thank you very much. In this case, I recommend creating a list called "Tracking" and adding a record to it every time the user clicks on the image. We should be able to save both user details (Created By ) and timestamp (Created) information this way. Then, using "Tracking" list and filtering by image name / ID, you can observe how many people clicked on it throughout the use or on a date basis.

 

Create "Tracking List" with columns

TitleImage ID (Optional)

 

Title column will be used to store the image name
Image ID will be used to store image ID (based on asset library / document library) (Optional)

 

Then use the below code in 'OnSelect' property of the image inside gallery

 

 

Patch('Tracking List',Defaults('Tracking List'),{Title: Title4.Text})

 

Between, how many users will use the system and what is the expected clicks on average for a month ?

 

Hello @takashi9999,

 

List Name --> change it based on your SharePoint DataSource name

v-bofeng-msft
Community Support
Community Support

Hi @takashi9999 :

I assume ClickOfView is a number column and WhoClickThis is a sinlge line of test column.

Please try:

Set the gallery's OnSelelct Property to:

Patch(
  Documents,
  ThisItem,
  {
    ClickOfView:ThisItem.ClickOfView+1,
    WhoClickThis:
        If(
            User().FullName in Split(ThisItem.WhoClickThis,";"),
            ThisItem.WhoClickThis,
            IsBlank(ThisItem.WhoClickThis),
            User().FullName,
            ThisItem.WhoClickThis&";"&User().FullName
        )
   }
)

vbofengmsft_0-1631856273493.png

Best Regards,

Bof

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,468)