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 / Label text with If con...
Power Apps
Answered

Label text with If condition getting from different field

(0) ShareShare
ReportReport
Posted on by 517

Hi There, 

Can someone help me to correct the formula. I am trying to get the year/month for current date if it is in Form Mode NEW else get the creation date from different field.

 

I've created a label with text formula = Year(Today())&Text(Today(),"mm") ---> i dont have any problem with this. this for NEW mode.

 

jaina_0-1694153116241.png

 

Then, the 2nd field is where default field creation date from SP List named in PowerApps DataCardValue178. (which will only have a record data once submitted)

 

So, the label i am working on has this text formula = 

If(
Form1_4.Mode = FormMode.New,
YrMonth.Text,
Form1_4.Mode = FormMode.Edit,
DataCardValue178.Text,
Form1_4.Mode = FormMode.View,
DataCardValue178.Text
)

 

jaina_2-1694153282767.png

 

 

But got an error. I also tried the below text formula but with no luck.

 

If(Form1_4.Mode = FormMode.New, YrMonth.Text, DataCardValue178.Text)

 

jaina_3-1694153504907.png

 

Appreciate your help please.

Thank you!!!

 

 

 

 

Categories:
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @jaina,

    Modify as below:

    If(
    Form1_4.Mode = FormMode.New,
    YrMonth.Text,
    Form1_4.Mode = FormMode.Edit,
    ThisItem.FieldName,
    Form1_4.Mode = FormMode.View,
    ThisItem.FieldName
    )
  • jaina Profile Picture
    517 on at

    Thank you, sir @v-qiaqi-msft 🙂 

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard