Some formulas and skills used in developing power apps canvas

1, Formula

1. Displays a record in which the start date of the Events table is the date selected in the calendar

Filter(Events,Text(start time,DateTimeFormat.ShortDate)=Text(_dateSelected,DateTimeFormat.ShortDate))
copy

2. Jump to the page and pass the value

Navigate(Screen2,ScreenTransition.Cover,{thisdoctor:ThisItem})
copy

3. Displays data with a start date of today

Filter(Events,Text(start time,DateTimeFormat.ShortDate)=Text(Today(),DateTimeFormat.ShortDate))
copy

4. Cancel record

ResetForm(Frm_ProjectDetailEdit);Back()
copy

5. Keep records

SubmitForm(Frm_ProjDetailEdit);Back()
copy

6. Edit record

EditForm(Frm_ProjDetailEdit);Navigate(ProjectDetailEdit,ScreenTransition.Fade)
copy

7. New record

NewForm(Frm_ProjDetailEdit);Navigate(ProjectDetailEdit,ScreenTransition.Fade)
copy

8. Delete record

Remove(Project,LookUp(Project,title=GalleryProjectList.Selected.title));Back()
copy

9. Calculate quantity

CountRows(Filter(HomeProjectList,Type.Value="newly build"))
copy

10. Realize search function

SortByColumns(Search(HomeProjectList,TextInput1.Text,"Title","ProjectName"),"Title",Ascending)
copy

11. A Label displays the sentence, "n records, sorted by the latest update"

Text(CountRows(Filter(Eļ¼Œvents,Text(start time,DateTimeFormat.ShortDate)<>Text(Today(),DateTimeFormat.ShortDate))),"[$-en-US]#Records, sorted by recent updates ")
copy

12. When setting the text type, multiple fields can be spliced in this way

ThisItem.'First Name' & " " & ThisItem.'Last Name'
copy

2, Small skills

The canvas application jumps from the details of a main record page and displays all sub records of a record

1. When the first page jumps, onSelect passes this parameter_ event_ Attendees is a sub list of this record

Navigate(attendee ,ScreenTransition.Cover,{this_event_attendees:thisevent.event_attendees.event_attendee})
copy

2. Add filter conditions to the item data of the gallery on the second page, as shown in the following figure

Filter(event_attendees,event_attendee exactin this_event_attendees)
copy

The drop-down list of power apps canvas realizes linkage filtering

1. Properties of the first drop-down box (1) The data source of items is the parent table (2) The value of value is the name field of the parent table

2. Properties of the second drop-down box (1) There is a lookup field in the Doctors table associated with the Hospital parent table (2) Filter the Doctors sub table if the value of its lookup field associated table is equal to the corresponding value selected in the first drop-down box (3) The fields of filtered records to be displayed in the second drop-down box are written out at the end of the formula

Filter(Doctors,Text(Affiliated organization.hospital)=Text(Dropdown1.Selected.hospital)).Name of doctor
copy

Jump operation value transfer

1. Using the Navigate formula, the value passed is defined as thislocator

Navigate(Screen2,ScreenTransition.Cover,{thisdoctor:ThisItem})
copy

2. Another page receives this locator and displays some fields

Save recent browsing records

1. Add record to recent browsing collection (1) Add the following formula to the jump Icon (2) The first parameter of collect is the name of the newly defined collection

Collect(recently_doctor,ThisItem)
copy

2. Show your browsing collection (1) In another recent browsing record interface, add a Gallery control and select the collection name from Data source

3. Clear recent browsing records (2)Recently_ Docs is the collection name defined above

Clear(Recently_doctors)
copy

4. power apps canvas to view the content of recent browsing records Open powerapps studio, click the file and select Collections button, and you can see it

3, Reference

Microsoft official document: reference formula of Power Apps https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/formula-reference

4, Summary

The above are some formulas and tips summarized when developing power apps canvas. They are relatively simple and you can refer to them

Posted by roswell on Thu, 12 May 2022 19:06:04 +0300