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 ?
Thanks for your answers.
Solved! Go to Solution.
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
)
)
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
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
)
)
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
Thanks you all, it worked ! I'm located in France that's why.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
170 | |
94 | |
65 | |
64 | |
61 |
User | Count |
---|---|
226 | |
162 | |
95 | |
82 | |
81 |