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 / In EditForm and ViewFo...
Power Apps
Answered

In EditForm and ViewForm - I want datacardvalue to reflect Parent.Default but I have a funtion added in Default for NewForm

(0) ShareShare
ReportReport
Posted on by 101

Hi need your advice.

 

My DataCard in a NewForm Mode has this default function:

If(Day (Today()) >=20 && Day (Today ()) <=31, Text (Today(),"[$-en-US]mmmm yyyy"), Text (DateAdd(Today(),-1,Months) "[$-en-US]mmmm yyyy"))

 

This is to reflect the previous Month but if entered within 20th to 31st of the Month it will reflect month today. And this works well when adding new entries.

 

But I don't want this as default when the form is in View or Edit Mode. I want to reflect the Parent.Default. 

 

I tried the syntax below but has error:

If(
 Form3.DisplayMode = DisplayMode.New,
 If(
Day(Today()) >= 20 && Day(Today()) <=31, Text(Today(),"[$-en-US]mmmm yyyy"),
Text(DateAdd(Today(), -1, Months),
"[$-en-US]mmmm yyyy")),
Parent.Default)
)

 

Thank you!

@NandiniBhagya20 @AhmedSalih @Drrickryp 

Categories:
  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @Sharinah1 , you can use this:

     

     

     

    If(FormName.Mode=FormMode.Edit || FormName.Mode=FormMode.View, 
    Parent.Default, 
    If(Day (Today()) >=20 && Day (Today ()) <=31, Text (Today(),"[$-en-US]mmmm yyyy"), Text (DateAdd(Today(),-1,Months) "[$-en-US]mmmm yyyy"))
    )

     

     

     

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • Sharinah1 Profile Picture
    101 on at

    Thank you. I just tried now and still an issue. 😔

     

    Sharinah1_0-1663737727502.png

     

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Sharinah1 , what is the error that your are getting?

     

  • Sharinah1 Profile Picture
    101 on at

    Here is the Details.

    Sharinah1_0-1663737981067.png

     

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Sharinah1, Okay, I see the error, use this formula in the Default property of the control inside the DataCard not the DataCard itself. So If you have an InputText inside the DataCard, select the InputText and add the formula into its Default property Instead. The Default property of the DataCard should be always: ThisItem.ColumnName << of the correspondent data. 

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Sharinah1, It seems you are using the default of the Control in side the DataCard. Your Formula need to include the conversion from String to Date Function DateValue()

     

     

    If(FormName.Mode=FormMode.Edit || FormName.Mode=FormMode.View, 
    Parent.Default, 
    If(Day (Today()) >=20 && Day (Today ()) <=31, DateValue(Text (Today(),"[$-en-US]mmmm yyyy")), DateValue(Text (DateAdd(Today(),-1,Months) "[$-en-US]mmmm yyyy")))
    )

     

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

     

     

  • Sharinah1 Profile Picture
    101 on at

    Thank you but I'm actually using this inside the Text Input. Sharinah1_0-1663738437871.png

     

    I tried removing the "else" function in the meantime and it works properly. And then I also tried to use this

    formula alone: 

    Sharinah1_1-1663738704901.png

     

    it works properly. But when merged to be a multiple if, there seems to be an issue.

     

     

     

  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    @Sharinah1, Try this:

    If(FormName.Mode=FormMode.Edit || FormName.Mode=FormMode.View, 
    Parent.Default, 
    If(Day (Today()) >=20 && Day (Today ()) <=31, DateValue(Text (Today(),"[$-en-US]mmmm yyyy")), DateValue(Text (DateAdd(Today(),-1,Months) "[$-en-US]mmmm yyyy")))
    )

     

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • Sharinah1 Profile Picture
    101 on at

    It is working now thank you so much. Realized that I just need to input it part by part first. And apparently my datacard was blank instead of ThisItem.NameofColumn. 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard