cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KamilHCP
Level: Powered On

Changing time from text input

Hi!

 

I have a text input in my gallery and I'd to have below the information when last text was put in - sounds easy, but I don't have clue how to get that... 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Changing time from text input

@KamilHCP 

Clarification needed.  I am not sure I understand what you are asking.

1.  If you want to know when the user last typed data into the current form you could Set a global variable when the user loads the screen

 

Set(CurrentTime, Blank())

 

Then for each control on the form you'd need to put the following code into the OnChange property

 

Set(CurrentTime, Now())

 

2.  If you want to know the last time a record was modified that info would have to be obtained from the datasource.  For example, if your datasource is a Sharepoint list you can get this info from the Modified column.  If your datasource is something like Excel you'd have to create a column called Modified and store the TimeStamp each time the form was submitted.  It really depends on the datasource.  More info needed if this is what you want.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Changing time from text input

@KamilHCP 

Clarification needed.  I am not sure I understand what you are asking.

1.  If you want to know when the user last typed data into the current form you could Set a global variable when the user loads the screen

 

Set(CurrentTime, Blank())

 

Then for each control on the form you'd need to put the following code into the OnChange property

 

Set(CurrentTime, Now())

 

2.  If you want to know the last time a record was modified that info would have to be obtained from the datasource.  For example, if your datasource is a Sharepoint list you can get this info from the Modified column.  If your datasource is something like Excel you'd have to create a column called Modified and store the TimeStamp each time the form was submitted.  It really depends on the datasource.  More info needed if this is what you want.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

KamilHCP
Level: Powered On

Re: Changing time from text input

Hello,

 

Thank you for your feedback, I really appreciate it!

 

The "Comment" is input text where user can add whatever he likes, but below on other field I'd like to have an information when he put it. For example Date, time


1.JPG

 

Your solution worked, I've changed it a bit (thank you although):

 

OnChagne input text I put :

 

Set(CurrentTime, Now())

Then, on Field text I added :

 

CurrentTime

 

But new problem has occurred. All the rows are changing in the gallery and I'd to have seperate change time for each line in the gallery (like input box text is)

2.JPG

 

I read this is because using variable in gallery, any ideas how to overcome this?

 

Super User
Super User

Re: Changing time from text input

@KamilHCP 
You'd have to store the last edited date/time in the datasource.  Reference the last edited date/time in a label field and then update each time the user writes in new data.

 

Yes, its because you are using a gallery and each record is just repeating the same variable.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

KamilHCP
Level: Powered On

Re: Changing time from text input

Any tips for me? I've been looking for answer for couple of hours

Super User
Super User

Re: Changing time from text input

@KamilHCP 

Unfortunately, that's all the ideas I have at the moment.  Hopefully another smart forum member can join the conversation and help us out.

KamilHCP
Level: Powered On

Re: Changing time from text input

Hello,

 

I've made this that way:

 

1. I added an input text into gallery for user to write comments

2. I added also a button that does: 

 

Patch(Zlecenia, ThisItem, {'Komentarz LGI':TextInput2.Text});
Patch(Zlecenia, ThisItem, {'Komentarz LGI data':Text(Now(),DateTimeFormat.LongDateTime)})

It updates the fields in my sharepoint data base - text from input and date/time when it happend

 

3. I added a label from database "Komentarz LGI data"

 

So whenever an user updates the comment using input text and button he updates the data base. This way is not super efficient but it works and adds not so much work for the user

Super User
Super User

Re: Changing time from text input

@KamilHCP 

Thanks for coming back to share your solution Kamil.  I was interested to read how you solved it!

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,766)