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

WebService - Data to PowerApps and embedding into a gallery

Hello Community,

 

I´ve got two problems I´m working on for a while now. 

 

First:

In my PowerApp I wanted to use a Webservice to get article data into a gallery. My current JSON schema is the following:

 

{
    "type": "object",
    "properties": {
        "status": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "articledata": {
            "type": "object",
            "properties": {
                "articlenumber": {
                    "type": "string"
                },
                "salesprice": {
                    "type": "string"
                },
                "producingcountry":
                    "type": "string"
                },
                "materialdata": {
                    "type": "object",
                    "properties": {
                        "material1": {
                            "type": "string"
                        },
                        "material2": {
                            "type": "string"
                        },
                        "material3": {
                            "type": "string"
                        },
                        "material4": {
                            "type": "string"
                        }
                    }
                },
                "colors": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "color": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "color"
                        ]
                    }
                }
            }
        }
    }
}

 

 

Im able to use articlenumber, salesprice, producingcountry and every oject in materialdata. What i cant use is the color array. Its filled as soon as I get the data in Flow and PowerApps also knows the object.

 

 

image.png

 

I know that it is possible to split the color array and write a string with all the items, but I hope someone knows a smarter way to do it.

 

 

Second:

In my PowerApp I´m calling the Flow and clearcollecting the data to a collection. To get the data into screen I had to use one gallery for every object. I had to use (myCollection.articledata) as the Items property of the gallery and (articledata.articlenumber) as the Text property of my Subtitle. 
I thought I could use one gallery for all of my webservice data, but I failed to get it done. 

 

 

I hope someone knows better ways. Thanks in advance! 

2 REPLIES 2
Community Support
Community Support

Re: WebService - Data to PowerApps and embedding into a gallery

Hi @newUseer ,

For your first question, do you want to retrieve the values from the Color array within the articledata object data? If you want to retrieve the values from the Color array within the articledata object data, I have made a test on my side, please take a try with the following workaround:

Add a Label control within your app, set the Text proeprty to following:

Concat(First(myCollection).articledata.Colors, Color & "&")

If you added this Label control within your Gallery, please set the Text property to following:

Concat(ThisItem.Colors, Color & "&")

 

For your second question, I think Single one Gallery could achieve your needs. On your side, please set the Items property of the Gallery to following:

myCollection.articledata

Within the Gallery, set the Text property of the Subtitle Label to following:

ThisItem.articlenumber

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
newUseer
Frequent Visitor

Re: WebService - Data to PowerApps and embedding into a gallery

Hi @v-xida-msft,

 

thanks for your effort so far. Your solution for my first question worked fine.

To the second one: 

I had to set the Text property of the Lable to "ThisItem.articledata.articlenumber" to see the articlenumber. But my problem is, if Ido it like that I can only see the articlenumber in my gallery. If i want to see the salesprice aswell I need to add another gallery with the same Items property and set the Text property to "ThisItem.articledata.salesprice".

 

Best regards and thanks in advance.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,682)