Power FX - Action Function Tutorial

Unlock the power of low-code app development with our video 'action function'! Dive into action functions that enhance interactivity in Power Apps. Discover how to seamlessly navigate between screens and effectively manage SharePoint data. Don’t miss out on mastering these advanced techniques—watch now for a transformative experience!

  • 04:18
  • 11 views
00:00:07
we explored functions that allow data manipulation.
00:00:10
In this video,
00:00:11
we will focus on some action functions
00:00:13
that allow interaction with the application itself,
00:00:16
enhancing its interactivity and user friendliness.
00:00:21
To illustrate these functions,
00:00:22
we will start with a concrete scenario.
00:00:24
We have a data source,
00:00:26
a SharePoint list called project tracking.
00:00:29
In our Power Apps application,
00:00:30
we have created two screens.
00:00:32
Screen 1.
00:00:34
This screen displays the data from the project tracking list within a gallery,
00:00:38
providing a synthetic view of the various projects.
00:00:41
Screen 2,
00:00:42
this screen contains several controls text fields,
00:00:45
date pickers,
00:00:47
drop down lists,
00:00:47
etc.
00:00:48
that allow modifying or adding new data to our SharePoint list.
00:00:53
To begin with,
00:00:54
we want the user to be able to switch from screen 1 to screen 2
00:00:58
by clicking on an icon.
00:00:59
To do this,
00:01:00
on screen one,
00:01:01
insert an icon,
00:01:02
e.g.,
00:01:02
an arrow or a button
00:01:04
that will serve as a trigger to navigate to screen 2.
00:01:08
Select the added icon and in the formula bar,
00:01:11
enter the navigate function.
00:01:14
The syntax is as follows.
00:01:18
Navigate is the function used to switch screens.
00:01:21
The first parameter,
00:01:22
screen 2 indicates the destination screen.
00:01:25
The second parameter specifies the type of
00:01:27
transition to apply when switching screens.
00:01:30
Here we use a fade transition,
00:01:32
but you can test the other types of transitions.
00:01:36
Go to preview mode to test your configuration.
00:01:39
By clicking on the icon,
00:01:41
check that the navigation to screen 2
00:01:42
is performed correctly with the chosen transition.
00:01:46
To improve user experience,
00:01:48
repeat the same process on screen 2.
00:01:51
Add an icon or button,
00:01:53
allowing the user to return to screen 1.
00:01:56
Thus,
00:01:57
the user can easily navigate between the two screens.
00:02:03
Now let's move on to interacting with the data in our SharePoint list.
00:02:07
Each control will correspond to the columns in the project tracking list.
00:02:11
For example,
00:02:12
you will have a text field for the project name,
00:02:14
a date picker for the completion date,
00:02:17
a drop down list for the project status,
00:02:19
etc.
00:02:20
Insert a button that you will name save.
00:02:25
This button will allow validating the data entered or modified by the user.
00:02:31
Select the save button
00:02:32
and in the formula bar,
00:02:34
use the patch function to add or update data in your SharePoint list.
00:02:38
The formula is as follows.
00:02:41
Project tracking is the name of your SharePoint list.
00:02:44
Defaults indicates that you are adding a new record.
00:02:48
If you want to modify an existing record,
00:02:50
you will need to replace this part with a reference to the record to be updated,
00:02:54
for example,
00:02:55
using the lookup function.
00:02:58
Inside the braces,
00:02:59
you associate each column of the list
00:03:01
with the values of the corresponding controls.
00:03:04
For the budget column,
00:03:05
you use the value function to convert the entered text to a number.
00:03:09
For the project status column,
00:03:11
which is of choice type,
00:03:13
you encapsulate the selected value in a value structure
00:03:16
so that the system correctly interprets the data.
00:03:20
Remarks.
00:03:21
Using defaults is essential when inserting a new record.
00:03:24
If you are modifying an existing record,
00:03:27
replace this part with the specific item you want to update.
00:03:31
Choices and SharePoint are structured with a value field.
00:03:34
It is crucial to respect this structure to avoid errors when saving data.
00:03:40
Test your configuration by filling in the controls with test data.
00:03:45
By clicking the save button,
00:03:47
check that the data is correctly added or updated in your SharePoint list.
00:03:52
In summary,
00:03:53
we have learned to use the navigate and patch
00:03:55
action functions in Power apps to enhance our application.
00:03:59
The navigate function facilitates navigation between screens,
00:04:03
providing a smooth transition
00:04:05
and improving user experience.
00:04:07
The patch function allows adding or modifying data
00:04:10
in a source such as SharePoint
00:04:12
by linking application controls to the corresponding columns in the list.

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

 

Mandarine AI: CE QUI POURRAIT VOUS INTÉRESSER

Reminder

Show