I am tasked with putting together a simple and quick PowerApp for our organization that will be giving COVID vaccinations in a few weeks. I want to log everything that is done including people that even start the application. I have the following code that should be at least creating an entry in a SharePoint table, but it is not. What might I be doing wrong? And this is in the main forms OnVisible event
Set(v, false ); //set the visible variable for the container
//Prepare the variables for the log
Set(thisEmployee, lblEmail.Text);
Set(n, Today());
Set(descrip, "Logged in");
//Save this to the log
IfError(Patch('COVID vaccines',Defaults('COVID vaccines'),
{Employee: thisEmployee},
{Logged: Today()},
{Notes: "Opened the application"}
),Notify(ErrorResult,NotificationType.Error),Notify("Saved",NotificationType.Success));
Solved! Go to Solution.
Hi @guyinazo ,
Although your code looks fine, try dissecting it - first does this work
Patch(
'COVID vaccines',
Defaults('COVID vaccines'),
{
Employee: "Test Employee",
Logged: Today(),
Notes: "Opened the application"
}
)
If so, add the variables back in (thisemployee first) and then the error bits.
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.
Hi @guyinazo ,
Although your code looks fine, try dissecting it - first does this work
Patch(
'COVID vaccines',
Defaults('COVID vaccines'),
{
Employee: "Test Employee",
Logged: Today(),
Notes: "Opened the application"
}
)
If so, add the variables back in (thisemployee first) and then the error bits.
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.
That does work. I tied the code to a button and it works. I tied the original code (changed Today() to Now() to capture the time also) and with the button it works. It seems like it is not triggering when tied to the OnVisible event
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
253 | |
246 | |
84 | |
36 | |
31 |
User | Count |
---|---|
328 | |
261 | |
123 | |
68 | |
44 |