web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to append newly se...
Power Apps
Answered

how to append newly selected date to a separate multi-line text field when original date field is changed

(0) ShareShare
ReportReport
Posted on by 256

In my power apps form (which connects to a SP List), I have two datacards/fields I'm specifically working with:

 

1) Expected Complete Date (Date & Time Field)

2) Changed Complete Dates (Multiple Lines of text field)

 

What I'm looking to do is, when someone is editing an entry in the form and they change the 'Expected Complete Date', I'd like for it to append the originally stored date from (1) into (2). This way a record can be kept of every time the 'Expected Complete Date' has been changed - for this specific item.

 

So if the 'Expected Complete Date' is currently set to 12/5/2023, and someone uses the date picker to change it to 12/7/2023 and then saves/updates the form, I'd like for the 'Changed Complete Dates' to have:

 

 

 

12/7/2023
12/5/2023

 

 

 

If they change it again to 12/10/2023 and save/update the form, I'd like for the 'Changed Complete Dates' to now have:

 

 

 

12/10/2023
12/7/2023
12/5/2023

 

 

 

and so on.

 

I'm trying to find out if there's a way to first, determine if someone changes the date field, and then second, if they do change the date, how to compare that new date with *only* the top line entry of a multi-line text field, to see if it's different. If it is different, then append the newly selected date to the *top* of the multi-line text field.

 

If I'm thinking about this all wrong and if there's a better way, I'm all ears!

 

Thanks in advance!

Categories:
  • Bilakanti Profile Picture
    1,226 on at

    @galos You can create a collection and onchange of datetime field store the selected value inside the collection and use can use concat function to append the collection. Below is the screenshot for your reference.

    Bilakanti_0-1676960365946.png

     

  • Verified answer
    galos Profile Picture
    256 on at

    OK I figured this out!  The easiest way was to select the 'DataCard' in the form, corresponding to the Multi-Line Text for 'Changed Complete Dates'.  In the 'Update' field, I added the following code:

     

     

     

    If(
     Gallery2.Selected.'ExpectedCompleteDate' <> ExpectedCompleteDate_DataCard_Value.SelectedDate,
     Text(ExpectedCompleteDate_DataCard_Value.SelectedDate & Char(10) & ChangedCompleteDates_DataCard_Value.Text),
     ChangedCompleteDates_DataCard_Value.Text
    )

     

     

     

     

    so basically, what is happening, is I'm comparing the original value of the 'Expected Complete Date' (from the gallery2 item that was selected) with the 'Expected Complete Date' actual value in the form. If these differ, then I set the Update field for the 'Changed Complete Dates' to first be the new value selected in the date field and then I append the existing values that are already there. If the date doesn't change, then just leave the existing 'ChangedCompleteDates' the same.

     

    To complete this, so if the form is in edit mode, do the above, otherwise, if it's in New mode, just add the selected date to the 'ChangedCompleteDates' field, do the following:

    If(
     Form.Mode=New,
     Text(ExpectedCompleteDate_DataCard_Value.SelectedDate),
     If(
     Gallery2.Selected.'ExpectedCompleteDate' <> ExpectedCompleteDate_DataCard_Value.SelectedDate,
     Text(ExpectedCompleteDate_DataCard_Value.SelectedDate & Char(10) & ChangedCompleteDates_DataCard_Value.Text),
     ChangedCompleteDates_DataCard_Value.Text
     )
    )

     

    This was sufficient for now - thank you @Bilakanti for your collection idea also! Great idea too!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard