Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Correction of If Formula for Table Records

(0) ShareShare
ReportReport
Posted on by

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

 

 

 

 

 

 

 

 

 

 

  • Verified answer
    WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: Correction of If Formula for Table Records

    @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.

  • MIA27 Profile Picture
    on at
    Re: Correction of If Formula for Table Records

    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
    146,702 Most Valuable Professional on at
    Re: Correction of If Formula for Table Records

    @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
    on at
    Re: Correction of If Formula for Table Records

    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

     

  • MIA27 Profile Picture
    on at
    Re: Correction of If Formula for Table Records

    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,

     

     

  • Verified answer
    BCBuizer Profile Picture
    22,034 Super User 2025 Season 1 on at
    Re: Correction of If Formula for Table Records

    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.

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: Correction of If Formula for Table Records

    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 ?)

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard