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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,069)