Skip to content

New Sample - Search Movies #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions samples/SearchMovies/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Search Movies

## Summary

This sample allows users to search for movies using any keyword and/or the year of release.
|Starting Screen|Only Keyword |Keyword + Year|
:-------------------------:|:-------------------------:|:-------------------------:
![starting page](assets/startPage.jpg) | ![searching with keyword](assets/searchingWithKeyword.jpg) | ![searching with keyword and year of release](assets/searchingWithYear+Keyword.jpg)

## Applies to

* [Microsoft Power Apps](https://docs.microsoft.com/powerapps/)

## Compatibility

![Power Apps Source File Pack and Unpack Utility 0.20](https://img.shields.io/badge/Packing%20Tool-0.20-green.svg)
![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-green.svg "Premium Power Apps license not required")
![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-green.svg "Does not rely on experimental features")
![On-Premises Connectors](https://img.shields.io/badge/On--Premises%20Connectors-No-green.svg "Does not use on-premise connectors")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-Not%20Required-green.svg "Does not use custom connectors")

## Authors

Solution|Author(s)
--------|---------
Search Movies | [Aaryan Arora](https://github.com/aaryan2134), Delhi Technological University

## Version history

Version|Date|Comments
-------|----|--------
1.0|January 19, 2023|Initial release

## Features

This sample allows the user to:

* Search for movies using any keyword.
* Search for movies using any keyword and the year of release.
* View the poster of the movie found.

## Prerequisites

This app requires OMDb API key. You can get one from [here](http://www.omdbapi.com/apikey.aspx).

## Data Sources

### OMDb Connector

This connector connects to the OMDb API and fetches the movie data using the keyword and/or year of release. It also provides the poster for the movie. You can add it to the app as follows:

* In the **Data** tab, click **Add data->connectors->OMDb**.
* Next, click on **Add a new connection**.
* Enter the API key and click **Connect**.

## Minimal Path to Awesome

* [Download](./solution/YOURSAMPLENAME.msapp) the `.msapp` from the `solution` folder
* Within **Power Apps Studio**, use the `.msapp` file using **File** > **Open** > **Browse** and select the `.msapp` file you just downloaded.
* Select the **Data** tab
* Connect the app with OMDb Connector as stated above.

## Using the Source Code

You can also use the [Power Apps CLI](https://docs.microsoft.com/powerapps/developer/data-platform/powerapps-cli) to pack the source code by following these steps::

* Clone the repository to a local drive
* Pack the source files back into `.msapp` file:

```bash
pac canvas pack --sources pathtosourcefolder --msapp pathtomsapp
```

Making sure to replace `pathtosourcefolder` to point to the path to this sample's `sourcecode` folder, and `pathtomsapp` to point to the path of this solution's `.msapp` file (located under the `solution` folder)
* Within **Power Apps Studio**, use the `.msapp` file using **File** > **Open** > **Browse** and select the `.msapp` file you just packed.

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

## Help

We do not support samples, but we this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

## For more information

* [Overview of creating apps in Power Apps](https://docs.microsoft.com/powerapps/maker/)
* [Power Apps canvas apps documentation](https://docs.microsoft.com/powerapps/maker/canvas-apps/)

<img src="https://telemetry.sharepointpnp.com/powerapps-samples/samples/SearchMovies" />

---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/SearchMovies/assets/startPage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
12 changes: 12 additions & 0 deletions samples/SearchMovies/sourcecode/Assets/SampleImage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Content": "Image",
"FileName": "/ctrllib/image/images/SampleImage.svg",
"IsSampleData": true,
"IsWritable": false,
"Name": "SampleImage",
"Path": "/ctrllib/image/images/SampleImage.svg",
"ResourceKind": "Uri",
"RootPath": "ms-appx:///ctrllib/image/images/SampleImage.svg",
"Schema": "i",
"Type": "ResourceInfo"
}
118 changes: 118 additions & 0 deletions samples/SearchMovies/sourcecode/CanvasManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"FormatVersion": "0.24",
"Header": {
"DocVersion": "1.326",
"MinVersionToLoad": "1.326",
"MSAppStructureVersion": "2.0"
},
"Properties": {
"AppCreationSource": "AppFromScratch",
"AppDescription": "",
"AppPreviewFlagsMap": {
"aibuilderserviceenrollment": false,
"allowmultiplescreensincanvaspages": false,
"appinsightserrortracing": false,
"appinstrumentationcorrelationtracing": false,
"autocreateenvironmentvariables": false,
"backfromhostaction": false,
"behaviorpropertyui": false,
"blockmovingcontrol": true,
"cdsdataformatting": false,
"classiccontrols": false,
"consistentreturnschemafortabularfunctions": false,
"copyandmerge": false,
"datatablev2control": true,
"delaycontrolrendering": true,
"delayloadscreens": true,
"disablecdsfileandlargeimage": false,
"disablecommandbar": false,
"dynamicschema": false,
"enableappembeddingux": false,
"enablebarcodereaderfeature": false,
"enablecomponentnamemaps": false,
"enablecomponentscopeoldbehavior": false,
"enableeditcacherefreshfrequency": false,
"enableexcelonlinebusinessv2connector": true,
"enableideaspanel": true,
"enableonstart": true,
"enableonstartnavigate": false,
"enablepcfmoderndatasets": true,
"enablepowerautomatepane": true,
"enablerowscopeonetonexpand": false,
"enablerpawarecomponentdependency": true,
"enablerulespanel": false,
"enablesaveloadcleardataonweb": false,
"enhanceddelegation": true,
"enhancedgalleryinitialization": true,
"errorhandling": true,
"excelcompatibility": false,
"expandedsavedatasupport": true,
"exportimportcomponents2": true,
"externalmessage": false,
"fluentv9controls": false,
"formuladataprefetch": true,
"formularepair": false,
"generatedebugpublishedapp": false,
"herocontrols": false,
"improvedmediacapture": false,
"improvedtabstopbehavior": false,
"keeprecentscreensloaded": false,
"longlivingcache": false,
"namedformulas": false,
"nativecdsexperimental": true,
"optimizedforteamsmeeting": false,
"packagemodernruntime": false,
"parallelcodegen": false,
"pdffunction": false,
"projectionmapping": true,
"reactformulabar": false,
"reliableconcurrent": true,
"reverttooldpowerautomate": false,
"rtlinstudiopreview": false,
"rtlsupport": false,
"supportcolumnnamesasidentifiers": false,
"tabledoesntwraprecords": false,
"untypedobject": false,
"usedisplaynamemetadata": true,
"useenforcesavedatalimits": true,
"useexperimentalcdsconnector": true,
"useexperimentalsqlconnector": true,
"useguiddatatypes": true,
"usenonblockingonstartrule": true,
"webbarcodescanner": false,
"zeroalltabindexes": false
},
"Author": "",
"ContainsThirdPartyPcfControls": false,
"DefaultConnectedDataSourceMaxGetRowsCount": 500,
"DocumentAppType": "Phone",
"DocumentLayoutHeight": 1136,
"DocumentLayoutLockOrientation": false,
"DocumentLayoutMaintainAspectRatio": true,
"DocumentLayoutOrientation": "portrait",
"DocumentLayoutScaleToFit": true,
"DocumentLayoutWidth": 640,
"DocumentType": "App",
"EnableInstrumentation": false,
"FileID": "c820dea4-683d-4433-aa39-41be2d3d8e6b",
"Id": "b716bad7-4439-4012-9998-0c085127e759",
"InstrumentationKey": "",
"LocalDatabaseReferences": "{}",
"Name": "Search+Movie.msapp",
"OriginatingVersion": "1.326"
},
"PublishInfo": {
"AppName": "Search Movie",
"BackgroundColor": "RGBA(0,176,240,1)",
"IconColor": "RGBA(255,255,255,1)",
"IconName": "Edit",
"LogoFileName": "",
"PublishDataLocally": false,
"PublishResourcesLocally": false,
"PublishTarget": "player",
"UserLocale": "en-US"
},
"ScreenOrder": [
"Screen1"
]
}
1 change: 1 addition & 0 deletions samples/SearchMovies/sourcecode/ComponentReferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
23 changes: 23 additions & 0 deletions samples/SearchMovies/sourcecode/Connections/Connections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"216a3d60-a4e5-44bd-b974-6b59d497c564": {
"connectionParameters": {
"sku": "Enterprise"
},
"connectionRef": {
"apiTier": "Standard",
"displayName": "OMDb",
"iconUri": "https://az787822.vo.msecnd.net/defaulticons/api-dedicated.png",
"id": "/providers/microsoft.powerapps/apis/shared_omdb-5f15604e617fbb29a6-5f46e134578db90099",
"isCustomApiConnection": true,
"parameterHints": {},
"parameterHintsV2": {}
},
"datasets": {},
"dataSources": [
"OMDb"
],
"dependencies": {},
"dependents": [],
"id": "216a3d60-a4e5-44bd-b974-6b59d497c564"
}
}
110 changes: 110 additions & 0 deletions samples/SearchMovies/sourcecode/ControlTemplates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"appinfo": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/appinfo",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": false,
"LastModifiedTimestamp": "0",
"Name": "appinfo",
"OverridableProperties": {},
"Version": "1.0"
},
"button": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/button",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": true,
"LastModifiedTimestamp": "0",
"Name": "button",
"OverridableProperties": {},
"Version": "2.2.0"
},
"groupContainer": {
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/groupContainer",
"IsComponentTemplate": false,
"IsPcfControl": false,
"IsWidgetTemplate": false,
"LastModifiedTimestamp": "0",
"Name": "groupContainer",
"Version": "1.0"
},
"image": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/image",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": true,
"LastModifiedTimestamp": "0",
"Name": "image",
"OverridableProperties": {},
"Version": "2.2.2"
},
"label": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/label",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": true,
"LastModifiedTimestamp": "0",
"Name": "label",
"OverridableProperties": {},
"Version": "2.5.1"
},
"rectangle": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/shapes/rectangle",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": true,
"LastModifiedTimestamp": "0",
"Name": "rectangle",
"OverridableProperties": {},
"Version": "2.3.0"
},
"screen": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/screen",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": false,
"LastModifiedTimestamp": "0",
"Name": "screen",
"OverridableProperties": {},
"Version": "1.0"
},
"text": {
"CustomGroupControlTemplateName": "",
"FirstParty": true,
"Id": "http://microsoft.com/appmagic/text",
"IsComponentTemplate": false,
"IsCustomGroupControlTemplate": false,
"IsPcfControl": false,
"IsPremiumPcfControl": false,
"IsWidgetTemplate": true,
"LastModifiedTimestamp": "0",
"Name": "text",
"OverridableProperties": {},
"Version": "2.3.2"
}
}
15 changes: 15 additions & 0 deletions samples/SearchMovies/sourcecode/DataSources/DropDownSample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"Data": "[{\"Value\":\"1\"},{\"Value\":\"2\"},{\"Value\":\"3\"}]",
"IsSampleData": true,
"IsWritable": false,
"Name": "DropDownSample",
"OrderedColumnNames": [
"Value"
],
"OriginalName": "DropDownSample",
"OriginalSchema": "*[Value:s]",
"Schema": "*[Value:s]",
"Type": "StaticDataSourceInfo"
}
]
8 changes: 8 additions & 0 deletions samples/SearchMovies/sourcecode/DataSources/OMDb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"ApiId": "/providers/microsoft.powerapps/apis/shared_omdb-5f15604e617fbb29a6-5f46e134578db90099",
"Name": "OMDb",
"ServiceKind": "ConnectedWadl",
"Type": "ServiceInfo"
}
]
Loading