Power Apps - First steps with the patch function Tutorial

Unlock the power of the Patch function in Power Apps with our detailed tutorial, 'First Steps with the Patch Function'. Learn how to effortlessly add and update SharePoint list data using an intuitive approach. Discover the secrets to connecting your app, configuring fields, and creating a user-friendly task management system! Ideal for power platform enthusiasts, this video is your gateway to mastering low-code development.

  • 04:17
  • 0 views
00:00:05
how to use the patch function in Power apps
00:00:08
to add or update data in a SharePoint list using simple examples.
00:00:13
The base used here is a SharePoint list called collaborator task.
00:00:18
It contains three main fields.
00:00:20
The first field is titled Title,
00:00:22
which allows you to enter the name of the task.
00:00:25
The second field is called status
00:00:28
and offers 3 selectable options.
00:00:31
To do
00:00:32
in progress and completed.
00:00:35
The 3rd field is named due date,
00:00:38
which allows you to specify the deadline of a task.
00:00:43
Once the list is created,
00:00:45
it must be connected to the Power App's application.
00:00:48
To do this,
00:00:49
go through the data menu,
00:00:51
then select the corresponding SharePoint site and list.
00:00:58
The application includes an input screen with a text input for the title,
00:01:04
a drop-down list for the status,
00:01:06
and a date picker for the due date.
00:01:09
When the user fills in these fields,
00:01:12
they click the add button.
00:01:14
This button uses a patch formula that allows the
00:01:17
creation of a new record in the SharePoint list.
00:01:20
The structure is simple.
00:01:22
The patch function is used with a collaborator task list,
00:01:26
followed by specifying that a new item is to be created using the defaults function.
00:01:32
Then the values to be recorded are defined.
00:01:36
The title field takes the text entered by the user.
00:01:40
The status field receives the value selected in the dropdown,
00:01:44
but in a particular format,
00:01:47
Since status is a choice field,
00:01:49
the value must be sent in the form of a record with a key called value.
00:01:54
Finally,
00:01:55
the due date is retrieved from the date picker.
00:01:59
The application includes a first screen with a gallery
00:02:01
that displays the list of tasks from SharePoint.
00:02:04
This gallery is connected to the collaborator task list.
00:02:08
Each card represents a task with its title,
00:02:11
status,
00:02:11
and due date.
00:02:13
When the user clicks on a card in this gallery,
00:02:16
they are taken to a 2nd screen
00:02:18
where they can modify the task information.
00:02:21
However,
00:02:22
for the input fields on the screen to be prefilled with the correct data,
00:02:27
The selected task must first be stored in a variable.
00:02:31
To achieve this,
00:02:32
in the on select property of the card or associated button for each gallery item,
00:02:38
the following formula is written.
00:02:40
Use the set function followed by the variable name.
00:02:43
This means the item clicked by the user is
00:02:46
stored in the variable name VR selected task.
00:02:49
Immediately after this instruction,
00:02:51
a second action is added to navigate to the edit screen.
00:02:55
As a result,
00:02:56
the on select property contains two instructions.
00:02:59
First,
00:03:00
set to store the task,
00:03:02
then navigate to go to the edit screen.
00:03:05
On the edit screen,
00:03:06
the input fields are configured to display the data from the variable.
00:03:11
In the text input field,
00:03:13
set the default property to var selected task title.
00:03:18
For the drop-down list set it to,
00:03:20
VA selected task status value.
00:03:23
And for the date picker,
00:03:25
right,
00:03:26
var selected task.
00:03:27
due date.
00:03:29
The user will then see the task data appear in the fields and can modify them freely.
00:03:35
Once the changes are made,
00:03:36
the user clicks the update button.
00:03:39
This button contains a patch formula that targets the very selected task variable.
00:03:45
For example,
00:03:45
the title field takes the value from the text input field.
00:03:49
The status field receives the selected value,
00:03:53
but always in the form of a record containing the value key.
00:03:56
Finally,
00:03:57
the due date is updated with the new date.
00:04:00
This method allows you to update an existing task easily
00:04:04
using a global variable to retain the selection between screens.
00:04:09
It provides a clear and easy to implement logic in any Power Up's application.

No elements match your search in this video....
Do another search or back to content !

 

Mandarine AI: WHAT YOU SHOULD KNOW

Reminder

Show