cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slong
Frequent Visitor

Display contents of JSON array in PowerApp Gallery

I store the following JSON object (retrieved from a REST endpoint) in a PowerApp Collection (called selectedItemDescription)

 

 

     "description": {
          "version": 1,
          "type": "doc",
          "content": [
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "text",
                  "text": "Feedback Item 1"
                },
                {
                  "type": "hardBreak"
                },
                {
                  "type": "text",
                  "text": "Feedback Item 2"
                }
              ]
            }
          ]
        }

 

 

I want to display each of text attributes containing "Feedback Item 1" and "Feedback Item 2" in a PowerApp gallery component.

 

I can display the top level data (e.g. type) without issue 

slong_0-1611158868797.png

However I can't get the text to display. Ideally in this scenario I would like two entries in the gallery like this.

 

Feedback Item 1 
Feedback Item 2

 

I've tried the following but it doesn't work in terms of displaying the text and only displays one gallery entry.

slong_1-1611159027342.png

Any help much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

I suspect the problem is that you are trying to access an Array within an Array at that level.  To get the feedback items you will probably need to use some version of first() to get the first record in the paragraph array before you access content.text



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
Pstork1
Dual Super User III
Dual Super User III

I suspect the problem is that you are trying to access an Array within an Array at that level.  To get the feedback items you will probably need to use some version of first() to get the first record in the paragraph array before you access content.text



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,258)