cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colbrook
Regular Visitor

DisplayMode Disabled

I'd like a bit of help please. 

 

I'll give you a bit of a scenario so you can understand what I want to do. We are creating some custom Powerapps to help us complete some daily IT checks. Each page has a question on, when you click submit and go to the next page, it adds an item to a list in Sharepoint. At the end you can go to a main home screen which will have 3 buttons. These buttons send you to a Daily Check, Weekly Check and Monthly Check app. 

When each app (Daily, weekly and monthly) submits data back to the list, it adds Daily, weekly or monthly to a column in the list so you can identify the frequency of that check. 

 

Now, when you get back to the home screen, I want it to disable the buttons depending on some criteria. So if you have completed a daily check today, then disable the daily check app button. If you have completed a weekly check in the past 7 days, disable the weekly check button. If you have completed a monthly check in the past month, disable the monthly check button. 

 

How can I do this in the DisplayMode of the button?

 

Thank you for your help. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @colbrook

 

My workaround is that I assume that there is a Date column named SubmitDate in the list to store the Date of submitting. then go to check the required date exists in that column.

Set DisplayMode of Daily Check button:

 

If(Today() in 'SP list'.SubmitDate,DisplayMode.Disabled,DisplayMode.Edit)

 

 Set DisplayMode of Weekly Check button:

 

If(IsEmpty(Filter('SP list',SubmitDate> DateAdd(Today(),-7,Days)&& SubmitDate<=Today())),DisplayMode.Edit,DisplayMode.Disabled)

 

 Set DisplayMode of Monthly Check button:

 

If(IsEmpty(Filter('SP list',SubmitDate> DateAdd(Today(),-30,Days)&& SubmitDate<=Today())),DisplayMode.Edit,DisplayMode.Disabled)

 

Hope this helps.

Sik

View solution in original post

8 REPLIES 8
v-siky-msft
Community Support
Community Support

Hi @colbrook

 

My workaround is that I assume that there is a Date column named SubmitDate in the list to store the Date of submitting. then go to check the required date exists in that column.

Set DisplayMode of Daily Check button:

 

If(Today() in 'SP list'.SubmitDate,DisplayMode.Disabled,DisplayMode.Edit)

 

 Set DisplayMode of Weekly Check button:

 

If(IsEmpty(Filter('SP list',SubmitDate> DateAdd(Today(),-7,Days)&& SubmitDate<=Today())),DisplayMode.Edit,DisplayMode.Disabled)

 

 Set DisplayMode of Monthly Check button:

 

If(IsEmpty(Filter('SP list',SubmitDate> DateAdd(Today(),-30,Days)&& SubmitDate<=Today())),DisplayMode.Edit,DisplayMode.Disabled)

 

Hope this helps.

Sik

As all the data is going into one list, will I need a filter to filter out the check type column? (Ie Daily, Weekly or Monthly)? 

 

Thanks for your help so far!

Ok so I managed to get this working, thank you. 

 

However, I am now trying to setup something in Power Automate to remind me when a daily check, weekly check or monthly check hasn't been completed. 

 

So I would like it to run at 12pm everyday for the daily check and and if an item hasn't been completed that day, that is categorized as a daily check, then email the users. Can anyone help? 

Hi @colbrook ,

 

Please try to create a scheduled flow.

1. Set the starting time and repeat intervals.

2. Get all Items from SharePoint, set Filter Query field as below, to filter the list based on the current date

Snipaste_2020-03-23_11-23-21.png

3. Add Condition, set left field to equals(length(body('Get_items')?['value']),0), set right field to true. this is to check length of the "Get items" body, if the current date doesn't exist in the list, the length should equal 0.

4. Add Send Email action in If yes branch, if the current date doesn't exist in the list, it should send an email to remind user.

Snipaste_2020-03-23_11-25-19.png

Test Result:

Snipaste_2020-03-23_12-03-19.png

Hope this helps.

Sik

Hi Sik, 

 

I am getting an error that says "Column 'Date' does not exist. "

 

I have checked the table to make sure there are no spaces etc in the column name and there's nothing obvious to me. Do you have any ideas? 

 

Thanks

Peter

Hi @colbrook 

 

Which step did the error happen?

Could you please share some screenshots about the Error message?

Sik

Hi Sik, 

It is the Get items filter. 

 

{
"status": 400,
"message": "Column 'Date' does not exist. It may have been deleted by another user.\r\nclientRequestId: 233cf1e3-4330-4427-8296-06a62c2d7b10\r\nserviceRequestId: 233cf1e3-4330-4427-8296-06a62c2d7b10"
}
 
Thanks, 
Peter

Hi @colbrook ,

 

For more accurate diagnosis of the issue, could you please share some screenshots about the Get Items flow step and the SharePoint list Date Column Name?

 

The error message means the Date doesn't exist in your SharePoint list.

Please go to SharePoint list - List Setting

Click on the Date column and see what name is displayed on the address bar .

Use that in the Filter field.

 

Hope this helps.

Sik

 

 

 

Sik

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,605)