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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update Sharepoint text...
Power Apps
Unanswered

Update Sharepoint text column conditionally

(0) ShareShare
ReportReport
Posted on by 818
For the Datacard belonging to a Sharepoint column, in the update property, I have this code: 
If(
    !IsBlank(DataCardValue11.Text);
    If(
        IsBlank(ThisItem.Historico1);
        Text(Today(); "dd/mm/yyyy") & "; " & User().FullName & ": " & DataCardValue11.Text;
        If(
            StartsWith(ThisItem.Historico1; Text(Today(); "dd/mm/yyyy") & "; " & User().FullName);
            Substitute(ThisItem.Historico1; Mid(ThisItem.Historico1; Find(": "; ThisItem.Historico1) + 2); DataCardValue11.Text);
            Text(Today(); "dd/mm/yyyy") & "; " & User().FullName & ": " & DataCardValue11.Text
        )
    );
    Blank()
)
 
What I want to happen is:
1- If both the item is empty, and there is nothing written in the text input DataCardValue11, it should update it to the date of today, name of user who is using app + what he wrote in said text input. (So something like 15/11/2024, Joshua Smith created a report)
2- If you go back to the app and save again, this should not be duplicated. (as of now, what will happen is "15/11/2024, Joshua Smith 15/11/2024, Joshua Smith created a report; the date and name will duplicate indefinitely)
3- The user should be able to edit the last part of what he wrote (created a report part). 
4- If you erase all what was written, it remains blank, not adding date and user again.
 
Unfortunately, I'm only acheaving 1 and 4. Meaning, there is duplication, user cannot edit message and if you erase everything and save, it stays blank.
 
So... How do I change this code for the update property?
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    Some condensing below, however the fundamental question is around your StartsWith function if it is a different day ? Can you please clarify
    With(
       {_Data: Text(Today(); "dd/mm/yyyy") & ": " & User().FullName};
       If(
          Len(DataCardValue11.Text) = 0;
    ​​​​​​​ Blank(); IsBlank(ThisItem.Historico1); _Data; StartsWith( ThisItem.Historico1; _Data ); Substitute( ThisItem.Historico1; Mid( ThisItem.Historico1; Find( ": "; ThisItem.Historico1 ) + 2 ); DataCardValue11.Text ); _Data & ": " & DataCardValue11.Text ) )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard