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

Collection values not being populated from JSON Azure Function

I am calling an Azure Function that returns JSON into a PowerApps Collection. The Collection schema gets populated, however, the values do not. Command, return, Collection and Swagger below. Can anyone tell me why the values are not populatiing while the schema does?

 

Command calling the Azure Function:

           ClearCollect(NPK,'wwfertcalc.azurewebsites.net'.FertCalc("16,6,18"))

 

Return of JSON:

Q1.PNG

Resulting schema only Collection:

Q2.PNG

Swagger:

Q3.PNG

6 REPLIES 6
HSI
Frequent Visitor

I am calling an Azure Function that returns JSON into a PowerApps Collection. The Collection schema gets populated, however, the values do not. Command, return, Collection and Swagger below. Can anyone tell me why the values are not populatiing while the schema does?

 

Command calling the Azure Function:

           ClearCollect(NPK,'wwfertcalc.azurewebsites.net'.FertCalc("16,6,18"))

 

Return of JSON:

Q1.PNG

Resulting schema only Collection:

Q2.PNG

Swagger:

Q3.PNG

HSI
Frequent Visitor

I am calling an Azure Function that returns JSON into a PowerApps Collection. The Collection schema gets populated, however, the values do not. Command, return, Collection and Swagger below. Can anyone tell me why the values are not populatiing while the schema does?

 

Command calling the Azure Function:

           ClearCollect(NPK,'wwfertcalc.azurewebsites.net'.FertCalc("16,4,18"))

 

Return of JSON per network analyzer:

[{"OrderNo":1001,"Mat":"DAP","Lbs":174.0,"N":1.57,"P":4.0,"K":0.0},{"OrderNo":1001,"Mat":"AN","Lbs":861.0,"N":14.43,"P":0.0,"K":0.0},{"OrderNo":1001,"Mat":"MOP","Lbs":600.0,"N":0.0,"P":0.0,"K":18.0},{"OrderNo":1001,"Mat":"FILL","Lbs":365.0,"N":0.0,"P":0.0,"K":18.0}]

 

 

 

Swagger:

swagger: '2.0'
info:
  title: wwfertcalc.azurewebsites.net
  version: 1.0.0
host: wwfertcalc.azurewebsites.net
basePath: /
schemes:
  - https
  - http
paths:
  '/api/WWTemplate/name/{name}':
    post:
      operationId: FertCalc
      description: Determines correct mix of fertilizer
      summary: Calculates fertilizer mix
      x-ms-summary: Calculates fertilizer mix
      x-ms-visibility: important
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - name: name
          in: path
          required: true
          type: string
          description: 'Input comma delimited string N,P,K'
      responses:
        '200':
          description: Fertilizer components
          x-ms-summary: FertilizerComponents
          schema:
            type: object
            properties:
              OrderNo:
                type: string
                description: Current Order No
                x-ms-summary: OrderNo
              Mat:
                type: string
                description: Type of material  DAP default first material
                x-ms-summary: MaterialType
              Lbs:
                type: number
                format: double
                description: Pounds of fertilizer
                x-ms-summary: LbsOfMaterial
              'N':
                type: number
                format: double
                description: Nitrogen
                x-ms-summary: Nitrogen
              P:
                type: number
                description: Phosphorus
                x-ms-summary: Phosphorus
              K:
                type: number
                format: double
                description: Potassium
                x-ms-summary: Potassium
      security:
        - apikeyQuery: []
definitions: {}
securityDefinitions:
  apikeyQuery:
    type: apiKey
    name: code
    in: query

 

v-yamao-msft
Community Support
Community Support

Hi HSI,

 

Are you able to connect the custom connector to a gallery and show all the data on the gallery?


If yes, please try to create the collection using the data you have displayed on the gallery to see if it will work.


Please try it on your side.

 

Best regards,
Mabel Mao

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

Yes the NPK collection is the data source for a gallery control. The gallery control is blank after calling the Azure Function, however the collection shows a schema. Are there any samples or any documentation of connecting to multi-row JSON?

 

From another forum posting, multi-row JSON appears to be a Swagger OpenAPI issue, however, we cannot get it working using any techniques we try, hinted at or not. Any guidance would be appreciated.

Hey was anyone able to resolve this? I am having a similar issue where my app makes an API call invoked by a ClearCollect and gets back valid JSON but it doesn't load it into the collection within the app...

The output type of your API is mentioned as object. If you are returning multiple records, it should be of type array. See this thread for an example. : https://community.powerapps.com/t5/General-Discussion/Get-Multiple-Rows-from-Azure-Functions-SQL-Com...

Pratap Ladhani,
Customer & Partner Success PM
Microsoft PowerApps and Microsoft Flow

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,759)