Optimizing Canvas App with Power Fx: Parsing & Binding JSON Collection to Gallery
Image Source: Shutterstock.com
Power Apps
Sep 22, 2023 2:30 PM

Optimizing Canvas App with Power Fx: Parsing & Binding JSON Collection to Gallery

by HubSite 365 about Rajeev Pentyala

Senior Software Engineer at Microsoft Power CAT Team

External Blog Post
Citizen Developer

Power AppsLearning Selection

Learn to parse and bind JSON data collection to a Gallery control using Microsofts ParseJson function from our expert guide.

The article, authored by 'Rajeev Pentyala', explains the process of utilising the ParseJson function to parse JSON data and bind it to a Gallery control within a Microsoft Canvas app. This process is illustrated through a scenario where a JSON string has been created containing a collection of 'Student' objects. Each object has properties such as Name, Mobile, Email, and City.

  • The JSON string is read and parsed into a collection.
  • This collection is then bound to the Gallery control.
  • The author provides an example involving a JSON string of students generated by ChatGpt, with an alternative suggestion to use ObjGen website for the JSON generation.
  • The ParseJson function is then used to parse this JSON string into a collection. A Text control is added to a new Canvas App and the JSON string is pasted into it.
  • The TotalStudents variable captures the count of student records in the JSON string using the CountRows and UpdateContext functions.
  • Finally, the JSON collection data are loaded into a PowerFx collection, which is then mapped to a Gallery control in the Canvas App.

Delving Deeper into Power Fx and JSON Parsing

Power Fx stands as a significant piece in Microsoft's Power platform. As seen from the article, using Power Fx's ParseJson function to manipulate JSON data proves to be highly functional and useful, especially in creating dynamic applications. The process might appear to be a bit intricate, particularly when dealing with complex JSON strings. However, understanding the core concepts of the function and its interaction with JSON data provides a new layer of versatility and control to app developers, allowing for more refined data handling and representation.

Read the full article Canvas App | Power Fx | Parse and bind JSON collection to Gallery

Learn about Canvas App | Power Fx | Parse and bind JSON collection to Gallery

The main topic of the text is how to use the ParseJson function to parse JSON data and bind it to the Gallery control in the Microsoft's Canvas App. The process involves creation of a JSON string containing a collection of 'Student' objects, which includes properties like Name, Mobile, Email, and City. Subsequently, this JSON string is parsed into a collection and then bound to the Gallery control. Further details include initializing a new Canvas App, adding a Text control and pasting the prepared JSON string. It also explains how to use a simple parse to count the student records in the JSON string.

 

More links on about Canvas App | Power Fx | Parse and bind JSON collection to Gallery

Bind JSON content to Gallery - Power Platform Community
Dec 22, 2022 — Solved: Hi All, I have written a custom connector and data is received in Powe Apps in JSON format. For e.g. OnSelect: customAPI.GetAllRecords() {
Canvas App | Power Fx | Parse and bind JSON collection ...
23 hours ago — Read and Parse the JSON string into a collection. Bind the collection to Gallery control. Let's get started with JSON preparation and parsing, ...
Power Apps ParseJSON Function: Get Collection From A ...
Oct 9, 2022 — Power Apps new ParseJSON function converts a text string into a record or table. It can also be used to return a collection from a flow.
How to convert json to collection in power apps
Oct 19, 2020 — Here is how I try to bind the list. enter image description here. How can I create a collection from JSON to bind to the gallery view?
How to convert JSON array from Power Automate into a ...
Jun 17, 2021 — JSON array to collection in Power Apps canvas app, Bind JSON array to a gallery in canvas app.
PowerApps Parse JSON examples
Sep 23, 2022 — The ParseJSON function in PowerApps can parse JSON strings into Power Fx objects and type and simplifies working with JSON in Canvas apps.
How to send JSON data to Power Apps ...
Jul 2, 2020 — As a workaround you can send your JSON object to power app as a string by using a Join action in Power automate. Then you need to parse that ...
Newly Released JSON Function for Power Apps
Jul 10, 2019 — In this article, I will show you how we can send data from a Canvas App using the freshly released JSON function.
Return table from power automate to canvas app using ...
Jul 2, 2022 — Here I am calling a third party WEB API and consume response in Power Automate and return result as JSON and bind to data table in canvas app.

Keywords

Microsoft Power Fx Tutorial, Power Apps Canvas App Guide, Parsing JSON in Microsoft Power Platform, Bind JSON to Gallery Control, Microsoft Power Fx Reference Function Parse Json