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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,081)