Skip to main content

Notifications

Power Apps - Building 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

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,636 on at
    Re: change color of text in text column based on New Form vs Edit form

    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

  • RA-22081248-0 Profile Picture
    RA-22081248-0 51 on at
    Re: change color of text in text column based on New Form vs Edit form

    Thanks for the reply, unfortunately ,

    YourFormName.Mode = FormMode.New,
     DoWhatever

    it is the DoWhatever part that I am struggling with.

     

    Ren

  • WarrenBelz Profile Picture
    WarrenBelz 145,636 on at
    Re: change color of text in text column based on New Form vs Edit form

    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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard