web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting Open and Close...
Power Apps
Unanswered

Setting Open and Close Date

(0) ShareShare
ReportReport
Posted on by

I need to be able to set a closing date for a power app form connected to a Sharepoint list.  It needs to go to a different Screen saying this form is closed after that date but not sure how to do it.

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

    Hi @Anonymous ,

    Are you wanting to write this date to a list and is the date the current date (today)?

  • Community Power Platform Member Profile Picture
    on at

    Hi Warren.  What I am wanting to have happen is that if a user links to a form (list) and tries to create a new item that is past a certain date then the form automatically goes to a form closed view.  I know you can do it in Infopath but I can't see anyone who has done a how to with a power app form.  I'm no coder and I've been going around in circles for a day now.  

     

    Regards

     

    Brett

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    OK @Anonymous ,

    Are you wanting to hard-code this or get it from a reference list?

    Either way, set the date to a Variable (I will call it vExpiry) and test for this on the New Record icon

    If(
     vExpiry<Today(),
     Notify("No new records are able to be entered",NotificationType.Error),
     NewForm(YourFormName)
    )

    This way they cannot get to the new record form.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Hi Warren.  Thanks for this.  Nearly there I think.  If I wanted the user to be presented with another view of the form explaining that the dates are closed is that possible rather than just preventing them from opening it?

     

  • Community Power Platform Member Profile Picture
    on at

    And may I ask how do I set a date to a variable?  Sorry I'm a designer so this is all rather foreign to me. 

  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    HI @Anonymous ,

    I will answer both questions. If you wanted the hard-code the date, use this syntax (replace with actual date)

    Set(vExpiry,DateValue("mm/dd/yyyy"))

    You could do this at App OnStart.
    If you wanted to put this on a single-line SharePoint reference list (I do a few of these) assuming it is called RefList, the ID is 1 and the field is RefDate, you would do the same with a Lookup

    Set(
     vExpiry,
     Lookup(
     RefList,
     ID=1,
     RefDate
     )
    )

    To answer your second question - this would give the user a View form on the current record, otherwise a New form if on or before the expiry date.

    If(
     vExpiry<Today(),
     ViewForm(YourFormName),
     NewForm(YourFormName)
    )

    If the form is on another screen, add Navigate to this.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Ok I think I've done what your suggesting but It is still remaining on the form screen, see screen grabs.  Whilst on the topic is there a way to create a new item where it doesn't pre populate it with the first record? I would assume this would a Newform on the App on new somehow?

     

    Thanks for your help so far, I really do appreciate it.

  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @Anonymous ,

    By date/time stamp on screenshots - also AEST? Central Queensland here.

    The bit of information I was missing was that this is a SharePoint Integration form (not a standalone app) - a bit more of a challenge here, but I hope achievable.

    Leave the App OnStart as it is and put this in the SharePoint Integration OnNew code

    If(
     vExpiry<Today(),
     ViewForm(SharePointForm1),
     NewForm(SharePointForm1)
    )

    This should work.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    I figured it out by putting:

     

    If( vExpiry<Today(), Navigate(Expired) )

     

    Where "Expired" is the name of the screen with the details of the form now being closed.

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @Anonymous ,

    Glad you got it going - did you see my other post?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard