The purpose of these sets of controls is to enable testing of specific scenarios to examine how the Power Apps Component Framework (PCF) responds to inputs and events.
The monitoring behaviour is controlled via the mode
command. Using mode allows the control to be placed into one or more monitoring modes. Multiple modes can be combined using a comma separated list (e.g. mode dataset,columns). The mode is stored in local storage state so that is it preserved between refreshed/re-loads, making it easy to test consistently.
The following modes are supported:
clearevents
- Clears any previous logged events. This is useful if you want to clear the log before additional information is logged in a specificupdateView
.error
- Simulates an error happening during theupdateView
data
- Outputs the dataset data receivedcolumns
- Outputs the columns configured in the datasethidden_columns
- Outputs the hidden columns with hidden=true or order=-1dataset
- Logs information about the dataset including loading, error state and pagingsize
- Shows the width/height received by the controlupdates
- Shows theupdatedProperties
array valuestate
- Outputs the control state
When an event is logged, it is categories as:
- init: ๐ข
- updateView: ๐ถ
- Manual Command: ๐
- getOutputs: ๐ผ
- destroy: Not reported
The Event is also followed by a counter value. So if there are 2 calls to updateView so far in the lifecycle, then it will show as ๐ถ 2
The following commands can be used:
-
mode [mode list]
- Sets one or modes (comma separated). Chain them in a specific order - e.g.clearevents,columns,dataset
-
event
- Updates theOutput 2
property with a random value and raises theOnAction
event -
eventnotify
- Updates theOutput 2
property the same as theevent
command, raises theOnAction
, except also callsnotifyOutputChanged
-
setselection
- Set the selected records to the first dataset row -
set [property] [value]
- Sets a property value - e.g.set bound_1 foo
-
clearproperty [property]
- Removes a property value - e.g.clearproperty bound_1
-
setstate [key] [value]
- Sets a control status value - e.g.setstate foo bar
-
clearstate
- Clears all the state values -
pagesize [records]
- Sets the page set for the dataset - e.g.pagesize 50
-
report
- Simulates anupdateView
call and reports based on the mode -
notify
- callednotifyOutputChanged
-
notify_n [count] [interval]
- CallsnotifyOutputChanged
a specific set of times at a given interval - e.g.notify 10 1000
will callnotifyOutputChanged
10 times at an interval of 1000ms -
cls
- Clears all log events -
refresh
- Refreshes the dataset -
loadnextpage
- Callsloadnextpage
-
loadpreviouspage
- Callsloadpreviouspage
-
loadexactpage [page]
- Callloadexactpage
for a specific page
The controls have bound, input and output parameters to allow you to test different scenarios:
dataset_a.dataset_a_field1
- ASingleLine.Text
dataset alias fieldformHeight
- AWhole.None
input field that is used to set the control height when placed on forms and sub grids.bound_1
&bound_2
-SingleLine.Text
fields that can be bound to Model Driven Form Fields or Canvas Expressionsoutput_1
&output_2
-SingleLine.Text
fields that are defined as output only fields.OnAction
- A custom event that is invoked usingevent
oreventnotify
Values can be setting using the set
command, and then notifyOutputChanged
raised by using the notify
command:
set bound_1 foo
notify