Hello,
I have a SharePoint list with period definition (essentially weeks) - defined by 'name' and then 'starting' and 'ending' date
I would like to use this Sharepoint list in my app, where depending on the current date, 'Week Number' (Combo box) gets filled in (default value) .
Please could anyone help?
Kind Regards,
Hello @WarrenBelz ,
I took your suggestion and further adjusted it to look at the ranges:
{
Week:
LookUp(
'Periods and Weeks',
'Start Date' <= DataCardValue5.SelectedDate && 'End Date'>=DataCardValue5.SelectedDate
).Week
}
This seems to work now. Hopefully I am not missing anything.
Thank you very much @WarrenBelz for your help!
Hi @WarrenBelz ,
I have used the code, however noting returns. Is the formula considering the range?
We have a "random" date (in the date picker) and the task is to find in which period this date sits. The date is not defined in the child SP list exactly, there are only ranges ie:
Today is 23/05/2023 and the data in the SP list would be Week 5, then period starting date 22/05/2023 and ending date of that period 28/05/2023. So the formula would return Week 5 in this case.
Hi @Ajwou ,
I think you need it "backwards" from what I posted = the DefaultSelectedItems of the Combo Box
{
week:
LookUp(
SPList,
'Start Date' = YourDatePicker.SelectedDate
).week
}
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.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi @WarrenBelz
I tried the suggested workflow, however it didn't work. I think I haven't explained the issue properly.
At the moment I have an app, that uses a sharepoint list. Within the app, I have date control, where I can select a date (default set to 'today') and also combobox control, which is linked to another sharepoint list with defined periods (period label, starting and ending date). So what I am trying to achieve to take selected date (today) in the app, find in which period (range in the child SP list) it belongs and return the 'week label' for that period into the combobox.
Hi @Ajwou ,
The DefaultDate (using the names you provided)
LookpUp(
SPList,
name = 'Week Number'.Selected.Week
).'Start Date'
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.
MVP (Business Applications) Visit my blog Practical Power Apps