I'm looking at an on call list from SharePoint.
I am using the Event ContentType and StartDate and EndDate from that type to show data on the dashboard screen. This will show the current On Call person, and the next On Call person. A person is on call for 1 week (Monday - Sunday)
If "StartDate" is within this week. I need to show the "Title" of that item.
I also, need to show the Next On Call (for next week).
Solved! Go to Solution.
Hi @SharePointAU,
Which control that you would like to use here to show the On called Person?
Would you please share more information about the On Call list?
If the On Call list contains the distinct User Name, then we could take use of the lookup function to find the user name:
For example, with the TextBox text property, we could write the formula in the following way for Current Week:
Lookup(OnCall List, And( DateDiff(DateAdd(Now(),-Weekday(Now(),11)),DateValue('Start Date'))>0, DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue('Start Date'))<=0 ) ).PersonName
For the Next week, formula should be:
Lookup(OnCall List, And( DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue('Start Date'))>0, DateDiff(DateAdd(Now(),14-Weekday(Now(),11)),DateValue('Start Date'))<=0 ) ).PersonName
Explanation for the formula:
Lookup function is used to find the proper record, and function is used to check if the start Date is within the needed week.
If there are several people Scheduled in the current week, then please consider change the Lookup function with Filter or search function, which then would return a table, and instead, change the text control with a dropdown or a list box.
Regards,
Michael
I found it. I was trying to use StartDate as text in the DateValue, but StartDate is already date/time. So i replaced "DateValue(StartDate)" with just "StartDate" and i get the correct response!
Now do you know why i'm still getting the informational warning shown below?
-NOTE: The output is correct, but I am receiving this warning.
Hi @SharePointAU,
Which control that you would like to use here to show the On called Person?
Would you please share more information about the On Call list?
If the On Call list contains the distinct User Name, then we could take use of the lookup function to find the user name:
For example, with the TextBox text property, we could write the formula in the following way for Current Week:
Lookup(OnCall List, And( DateDiff(DateAdd(Now(),-Weekday(Now(),11)),DateValue('Start Date'))>0, DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue('Start Date'))<=0 ) ).PersonName
For the Next week, formula should be:
Lookup(OnCall List, And( DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue('Start Date'))>0, DateDiff(DateAdd(Now(),14-Weekday(Now(),11)),DateValue('Start Date'))<=0 ) ).PersonName
Explanation for the formula:
Lookup function is used to find the proper record, and function is used to check if the start Date is within the needed week.
If there are several people Scheduled in the current week, then please consider change the Lookup function with Filter or search function, which then would return a table, and instead, change the text control with a dropdown or a list box.
Regards,
Michael
This is a great help, as it points me in a direction I had not known existed with the Lookup.
The On Call List is a SharePoint OnPrem list, that has 1 person on call each week. StartDate is the default date/time field provided by the Event Content Type.
I have applied your formula to a Text box, but receive the following error.
Error:
Forumla as applied
LookUp('OnCallList',
And(DateDiff(DateAdd(Now(),-Weekday(Now(),11)),DateValue(StartDate))>0,
DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue(StartDate))<=0)).AssignedTo_Text
I found it. I was trying to use StartDate as text in the DateValue, but StartDate is already date/time. So i replaced "DateValue(StartDate)" with just "StartDate" and i get the correct response!
Now do you know why i'm still getting the informational warning shown below?
-NOTE: The output is correct, but I am receiving this warning.
Hi,
Good day!
I am new in Powerapps and I have similar issue with the above.
I created an attendance list in sharepoint online with 4 columns ("Created By", "Reason for Leave", "From" & "To").
Now I want to create an app in powerapps to show only those persons who are on leave today with reason and with "From" & "To". Is this possible?
Thank you in advance.
Mike
Yes, That is similar to what I was trying to do. You'll need to use a formula similar to the ones above.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
276 | |
236 | |
83 | |
38 | |
35 |
User | Count |
---|---|
353 | |
242 | |
129 | |
73 | |
53 |