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 / Correction of If Formu...
Power Apps
Answered

Correction of If Formula for Table Records

(0) ShareShare
ReportReport
Posted on by 2

I have a table  view record with connected to Sharepoint List. Its working fine, But when I try to add some more design to alert to user by using IF with emogy, then no result no error

 

sharepoint list and data type to explain better :

 

MIA27_0-1679761893261.png

 

 

Applied IF() on Date Field , not working, 

MIA27_1-1679761958184.png

 

 

Applied IF() on Numeric field, still not working :

 

MIA27_2-1679762018150.png

 

My canvas view with error result

 

MIA27_3-1679762068108.png

 

Could not understand the reason of error.

 

Kindly guide

 

Also tried the below at last - still not work

MIA27_0-1679762923628.png

 

 

 

 

 

 

 

 

 

 

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

    Hi @MIA27 ,

    Two things - why are you using text conversions on SharePoint date fields (they should just compare on their own), but most importantly, Data Tables are generally not able to accept design elements like galleries are (what character are you using to get those red and blue circles ?)

     

  • Verified answer
    BCBuizer Profile Picture
    22,577 Super User 2026 Season 1 on at

    Hi @MIA27 ,

     

    I got both to work:

     

    Date:

    BCBuizer_0-1679779307767.png

    As @WarrenBelz mentioned, the text conversion in the condition caused the issue.

     

    Number:

    BCBuizer_1-1679779337775.png

    In you formula there was a brace to many at the end.

  • MIA27 Profile Picture
    2 on at

    Sir,

    Text conversion is required as the date displayed in sharepoint and in powerapp is in the format 3/31/2023 12:00 AM (mm-dd-yyyy)

    While users requirement is to show in dd-mm-yyyy , I mean like this 31/03/2023. 

    As you and Mr. Buizer guided, in comparison I removed the format and it worked, and later i applied the format in the display and it worked

    If(ThisItem.BdEndDate < Today(),"🔴","🟢") & " "
    & Text(ThisItem.BdEndDate,"dd-mm-yyyy")

     

    As the table does not accept design element, therefore I tried to implement an idea of adding a sign showing the user that Red circle it is expired and green it is still not. Its emogy - keeping the cursor at the required place, to press Window key + . , it opens up the emogy list and it can be selected from there. Also noted that it is accepted in all places even in App Naming also.

     

    I need your advise on the below 2 requirement : 

    a) Now the user wants the yellow indication if the expiry is coming within 10 days, so that they can start preparation. Need to add another If within If . I am stuck here. 

     

    b) The comparison I did was based on date and Number. But if the situation will be based on Text then = operator will work.

     

    Please guide in the above 2 requirement, for my knowledge and further implementation in work.

     

    Thank you,

     

     

  • MIA27 Profile Picture
    2 on at

    Sir,

    Thank you both worked. date worked after removing the format and number worked after removing the last bracket,

     

    A bit stuck for few more query, posted in the Mr. Warren reply, Could be helpful if you can also have a look and guide some idea on it.

     

    regards

     

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

    @MIA27 ,

    Firstly @BCBuizer has solved the first part - I am actually surprised your Data Table accepted the non-standard character (although I do not use either). As for the dates, the format is actually stored in SharePoint in UTC and converted by your Regional Settings, so you can use the actual date for the comparison and the Text conversion for the display (as you have now) OR simply fix your Regional Settings on the SharePoint site and / or your local devices.

    If(
     ThisItem.BdEndDate < Today(),
     "🔴",
     ThisItem.BdEndDate <= Today() + 10,
     "🟡",
     "🟢"
    ) & " " & 
    Text(ThisItem.BdEndDate, "dd-mm-yyyy")

     

  • MIA27 Profile Picture
    2 on at

    Sir,

    Thank you, had to add another IF in-between and it worked, all the 3 colors. 

     

    Was expecting your advise on my second parts of requested question

    b) The comparison I did was based on date and Number. But if the situation will be based on Text then = operator will work.

     

    For example Like for any Field Text is Expired, can I put the criteria

    ThisItem.ValidityStatus = "Expired"

     or it should be in 'Expired' in single quote.

     

    This home work will help me to cover all major 3 types of criteria for my learning and utilization.

     

    Regards

     

     

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

    @MIA27 ,

    You do not need the second If()  (as per what I posted).- although it will also work with it. "Expired" needs to be in double quotes if it refers to the Text value.

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
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard