cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Apoloduvalis
Regular Visitor

Canvas app Form unable to get fields from Custom Connector returning tabular data from REST API

I created a Custom Connector our of my REST API that returns tabular data. I used it as a datasource in a canvas powerapp, which store the records from the custom connector into a collection. This collection is used as datasource by a Gallery which successfully displays the items and attributes of each item. However, when I try to create an Edit Form that uses the custom connector as datasource it cannot access the fields. It does not work using directly the custom connector as data source either.

 

In this answer from @aorphan I read that you can use custom connectors in forms as long as they return tables instead of actions.  And as far as I can see, the content of the collection is tabular data:

dataTypeTable.png

Even the columns of the collection can be accessed as attributes of the item displayed by the Gallery:

ItemFields.png

However, even after setting the collection as datasource of a new Edit Form, it is unable to add any fields from the datasource:

FormFields.png 

Just in case my data needs some richer definition to be correctly interpreted by the Form, the JSON returned by my API looks like this:

 

{
    "quotes": [
        {
            "quote_pk": 347,
            "shipment_name": "test add leg",
            "organization_ff_name": "LIFE",
            "quote_id": "1234",
            "effective_until": "2020-05-10",
            "eta": "2020-05-14T12:00:00Z",
            "price": 100.0,
            "quote_status": 2
        },
        {
            "quote_pk": 345,
            "shipment_name": "test modal review",
            "organization_ff_name": "LIFE",
            "quote_id": "123",
            "effective_until": "2020-05-11",
            "eta": "2020-05-22T12:00:00Z",
            "price": 1749.94,
            "quote_status": 6
        }
    ]
}

 

And the definition of my Custom Connector goes like this:

 

swagger: '2.0'
info: {title: some title, description: some description, version: '1.0'}
host: server.domain.com
basePath: /organizations/endpoint/
schemes: [https]
consumes: []
produces: []
paths:
  /organizations/endpoint/shipment_quotes/: {}
  /shipment_quotes/:
    get:
      responses:
        '200':
          description: default
          schema:
            type: object
            properties:
              quotes:
                type: array
                items:
                  type: object
                  properties:
                    quote_pk: {type: integer, format: int32, description: quote_pk}
                    shipment_name: {type: string, description: shipment_name}
                    organization_ff_name: {type: string, description: organization_ff_name}
                    quote_id: {type: string, description: quote_id}
                    effective_until: {type: string, description: effective_until}
                    eta: {type: string, description: eta}
                    price: {type: number, format: float, description: price}
                    quote_status: {type: integer, format: int32, description: quote_status}
                description: quotes
      summary: peration summary
      description: operation description
      operationId: operationId
      parameters:
      - {name: Content-Type, in: header, required: false, type: string}
      - {name: Accept, in: header, required: false, type: string}
definitions: {}
parameters: {}
responses: {}
securityDefinitions: {}
security: []
tags: []

 

Please help me to get the datasource right so the form be able to add its fields, or at least let me know in case this is not possible for some reason so I can move on.

1 REPLY 1
Apoloduvalis
Regular Visitor

According to this answer in Stackoverflow, the feature of dynamically loading the fields of a record from a Custom Connector is not supported by Forms editor, no matter it is a table instead of actions. 

However, beyond the fact that the form fields cannot be dynamically generated, using the approach of assign each field in form's datacards to a column of the selected item of the gallery seems to do the trick. 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (72,895)