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 / change color of text i...
Power Apps
Answered

change color of text in text column based on New Form vs Edit form

(0) ShareShare
ReportReport
Posted on by 51

Hi,

I am having trouble with a formula.  I will explain what I am trying to do:

1) I have a Text column, (DatacardValue7), that I would like to search the SharePoint List for duplicates when a user is entering the data, before Submit/Save, to see if it finds a duplicate value. So the user doesn't waste their time entering a lot of data only to have the system not save, since the Title Column will not save a duplicate, only unique values.

2. I have a Label,(Label9) where I would like it to Display "Duplicate Found" in RED, or be blank if no duplicate found after the search for duplicates is done on the Text column.

3. My form is 'GOS Daily Log V24'

4. I would like this to be done on New form only, as we edit the form and I do not want to have the Label (label9) visible pr perform a check for duplicates on the Text column(DatacardValue7) in Edit, since it will undoubtedly return a Duplicate.

 

Help on this formula will be greatly appreciated!

 

Ren

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    Hi @ren0927 ,

    Test for the Form Mode

    If(
     YourFormName.Mode = FormMode.New,
     DoWhatever
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • RA-22081248-0 Profile Picture
    51 on at

    Thanks for the reply, unfortunately ,

    YourFormName.Mode = FormMode.New,
     DoWhatever

    it is the DoWhatever part that I am struggling with.

     

    Ren

  • Verified answer
    WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    HI @ren0927 ,

    Probably something like this

    If(
     YourFormName.Mode = FormMode.New && 
     !IsBlank(
     LookUp(
     SPList,
     YourTextField = DataCardValue7.Text
     ).YourTextField,
     Notify(
     "Duplicate found",
     NotificationType.Error
     ),
     SubmitForm('GOS Daily Log V24')
     )
    )

     

    Please click Accept as solution 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 Thumbs Up.

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard