cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fikyf
Helper I
Helper I

Record When User/visitor click button using Patch

Hi,

 

Hoping someone can help because I just cannot work this out. I created icon in Gallery to launch attachment and when the user/visitor click the icon, it will bring to new tab of attachment and record the status.

Launch attachment is success but the record status is not work.

This is my Gallery :

fikyf_0-1628825316712.png

Patch(FormContract.Updates,FormContract.LastSubmit,{SubmitStatus:"Completed"});Launch(First(ThisItem.Attachments).AbsoluteUri)

then I want to call the patch record in other screen

fikyf_2-1628825479716.png

Please inform me if there is any wrong formula

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@fikyf 

 

Do you want Append Text and Add some time stamps and user info? watch this video 

Append Text - Using forms or Patch create update only fields 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

View solution in original post

6 REPLIES 6
Ramole
Super User
Super User

@fikyf 

 

Are you patching a form to where ? I don't see DataSource like 

New Record

Patch( DataSource, Defaults( DataSource ), { SubmitStatus:"Completed" },FormContract.Updates );Launch(First(ThisItem.Attachments).AbsoluteUri)

 

Is the SubmitStatus a choice field ?

 

If yes change to SubmitStatus: {Value: "Completed"}

 

 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
fikyf
Helper I
Helper I

Hi @Ramole ,

 

Thanks for your respond. After change the formula, I success to update the record :

Patch('DDF List Upload',Gallery1.Selected,{'Log History':"Read"})

fikyf_1-1628996978913.png

But its only record one data, I need to record multiple data in that column and also with the date and person who click the button.

Do you have any idea how to record multiple data to sharepoint list and also include the date and the person/viewer.

So what I want the 'Log History' will capture this :

Read on 8, Aug 2021 by {person in our organization}

Read on 10 Aug, 2021 {person in our organization}

 

Hi @fikyf 

see below the instruction 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

Hi @fikyf 

 

 

 

 

 

 

        
        Patch(
            'DDF List Upload',
             Gallery1.Selected,
            
            {
                  'Log History':"Read",
                  Title: User().FullName,
                  DateEdited: Now(),
                  DocumentViewedID:Gallery1.Selected.ID

}

)

 

 

 

 

As I cannot see you list screenshot, just add create a field name DateEdited as Single line of text  and DocumentViewedID as Single line of text , that way you will know which document is viewed also

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

@fikyf 

 

Do you want Append Text and Add some time stamps and user info? watch this video 

Append Text - Using forms or Patch create update only fields 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
fikyf
Helper I
Helper I

hi @Ramole ,

 

Thank you so much, this is exactly what I mean, you're very helpful

 

I watched your video reference and make some modification,

Set(
varRecord,
ThisItem
);
Patch(
'DDF List Upload',
varRecord,
{'Log History': varRecord.'Log History' & "Read " & User().FullName & " " & Now() & " " & Char(13)}
);
Launch(First(ThisItem.Attachments).AbsoluteUri)

fikyf_0-1629003373322.png

now, if user click the icon in the gallery, he will launch attachment and it also record their activity in log history (by time stamp)

 

Thank you @Ramole 

Regards,

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,671)