cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nicolaslegall
New Member

Problem with SET property

Hello, 

 

I'm trying to build a powerapps calendar application, but to upgrade my calendar, i'm trying to use the "Set" function like " Set( _dateSelected, Today() );" or  "Set( _firstDayOfMonth, DateAdd( Today(), 1 - Day( Today() ), Days ) );" like in this documentation : https://docs.microsoft.com/fr-fr/powerapps/maker/canvas-apps/screen-templates/calendar-screen-overvi...

But this display a error, is the documentation outdated or am I doing something wrong ?

 

calendar3.PNG

 

Thanks for your answers.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

@nicolaslegall ,

Depending on your region your code will be either

Set(
   _dateSelected,
   Today()
);
Set(
   _firstDayOfMonth, 
   DateAdd(
      Today(),
	  -1,
      Days
   )
);
Set(
   _firstDayInView,
   DateAdd(
      _firstDayOfMonth,
      -(Weekday(_firstDayOfMonth) - 2 + 1),
      Days
   )
)

or

Set(
   _dateSelected;
   Today()
);;
Set(
   _firstDayOfMonth; 
   DateAdd(
      Today();
	  -1;
      Days
   )
);;
Set(
   _firstDayInView;
   DateAdd(
      _firstDayOfMonth;
      -(Weekday(_firstDayOfMonth) - 2 + 1);
      Days
   )
)

View solution in original post

6 REPLIES 6
Nogueira1306
Super User
Super User

You are missing a ";" in the end of Set

Set(_dateSelected, Today() );

 

If this does not solve your problem, please put the mouse over the error and tell me te error

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

Hello @Nogueira1306 , thanks for your answer,

 

Even with "Set( _dateSelected, Today() );", it's not working, and I got 2 errors "number of invalid arguments : 1 were received, 2 were expected", and "unexpected characters, the formula contains "ParentClose" while "error" is expected.".

 

Moreover, when I overview the Set function, it tells me the syntax "Set(variable; value)", that's why i'm asking about documentation that is outdated.

Documentantion is notoutdated. That has to do with Power apps language and location.

In US tehy use "," over ";". In Portugal we use ";" for example. YOu need to check your region

WarrenBelz
Super User
Super User

@nicolaslegall ,

Depending on your region your code will be either

Set(
   _dateSelected,
   Today()
);
Set(
   _firstDayOfMonth, 
   DateAdd(
      Today(),
	  -1,
      Days
   )
);
Set(
   _firstDayInView,
   DateAdd(
      _firstDayOfMonth,
      -(Weekday(_firstDayOfMonth) - 2 + 1),
      Days
   )
)

or

Set(
   _dateSelected;
   Today()
);;
Set(
   _firstDayOfMonth; 
   DateAdd(
      Today();
	  -1;
      Days
   )
);;
Set(
   _firstDayInView;
   DateAdd(
      _firstDayOfMonth;
      -(Weekday(_firstDayOfMonth) - 2 + 1);
      Days
   )
)
WarrenBelz
Super User
Super User

Hi @nicolaslegall ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Visit my blog Practical Power Apps

nicolaslegall
New Member

Thanks you all, it worked ! I'm located in France that's why.

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 (4,219)