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 / Setting variable based...
Power Apps
Unanswered

Setting variable based on Date column value

(0) ShareShare
ReportReport
Posted on by 24

Hi All, 

 

I am customizing SharePoint forms and in the Edit form, if the Approved Date has a value, then all the date cards will be have the Display Mode set to 'View'. 

 

I set the global variable: 
If(IsBlank(Text(DataCardValue11_2.SelectedDate)),Set(approvedDate,true),Set(approvedDate,false)

 

Displaymode of each datacard: If(approvedDate, DisplayMode.View, DisplayMode. Edit)

 

This doesnt work, can you please suggest or recommend how to set this variable coreectly? 

 

Thanks in advance!

 

regards, 

MB

Categories:
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @KSMB ,

    If you want the Variable to be true if the date picker is blank, try this

    Set(
     approvedDate,
     Value(DataCardValue11_2.SelectedDate)=0
    )

     

    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.

  • KSMB Profile Picture
    24 on at

    Hi @WarrenBelz , Thank you for the idea, I set this in 'On Edit' property of SharePoint Integration control. 

    When I edit a list item first time, condition is not triggered. But I cancel and edit the same list item again, everything works as expected. 

    Tried to set the variable in EditScreen- OnVisible() as well and same issue. Not able to figure out what is going on.. : (

     

  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    @KSMB ,
    Let's go a step back (replace with your date field name) at screen OnVisible

    Set(
     approvedDate,
     Value(SharePointIntegration.Selected.YourDateFieldName)=0
    )

     

    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.

  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @KSMB ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

  • KSMB Profile Picture
    24 on at

    Hi @WarrenBelz , I had to drop the idea of using data time picker as the value of variable didnot refresh as expected. So I used a workaround of using a calculated column value in the form which tells whether the approved date is present or not for a list item. 

    Thanks, 

    KSMB

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard