cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

In between function for App

Hello everyone,

 

currently i'm building an App,where it is possbile to book a bike.

With my code I'm able to check a date + time and the number of the bike, but i'm not able to check the time in between. For example: I book a bike from 12.12.2019 at 5pm to 7 pm on the same day, but once i change the time from 6pm to 7pm, it just goes thru, even its booked from 5 - 7 pm.

What can i do, that my code does a check, if its gone between that time or date?

 

If(
LookUp(     
booking;   
DataCardValue9.Text = bikenumber&& 
 
Value(Datum_x0020_PickUp;"[$-de-DE]dd/mm/yyyy HH:mm") >= Value(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value); Value(MinuteValue1.Selected.Value); 0))
&& 
Value(Datum_x0020_Return;"[$-de-DE]dd/mm/yyyy HH:mm")= Value(DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value); Value(MinuteValue2.Selected.Value); 0));

"OK" 
    ) = "OK";
Set(
 MyView; "It doesnt work"
 );
   

Set(
 MyView;
 "It works" & SubmitForm(EditForm1)
    )
)

hope someone has an Idea, what to do.

Thanks alot

 

5 REPLIES 5
Sijts
Level 8

Re: In between function for App

try to split date and time, this you can check if this date is already picked for this bicycle and if the time you want to rent it another time is outside the time slot of already hired bike. if date is true but time is false then it is ok to rent it out again.

Anonymous
Not applicable

Re: In between function for App

@Sijts  i tried something like that before, but mostly had problems with that. Could you show me in code, how you would do it?

Thanks alot in advance

Sijts
Level 8

Re: In between function for App

I do not have some code, but why don't you try a filter?

that way a the possible options will be filtered out.

first(filter(bookings, where this and that)).bikeno <>""

 

Community Support Team
Community Support Team

Re: In between function for App

Hi @Anonymous ,

Try this formula:

If(
     IsEmpty(LookUp(     
             booking;   
             DataCardValue9.Text = bikenumber&& 
             Value(Datum_x0020_PickUp;"[$-de-DE]dd/mm/yyyy HH:mm") >= Value(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value); Value(MinuteValue1.Selected.Value); 0))
             && 
             Value(Datum_x0020_Return;"[$-de-DE]dd/mm/yyyy HH:mm")= Value(DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value); Value(MinuteValue2.Selected.Value); 0))
             );
      variable1=true;variable1=false 
   )


If(variable1=false; Set( MyView; "It doesnt work" ); Set( MyView;"It works" );;SubmitForm(EditForm1) )

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: In between function for App

Hey @v-yutliu-msft 

 

it doesnt work with "variable1" and i have to use for lookup that "Ok" = "Ok" otherwise it doesnt take it.

 

Not sure to be honest.

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,714)