zapier-platform icon indicating copy to clipboard operation
zapier-platform copied to clipboard

Look into supporting inputFields with list and children

Open BrunoBernardino opened this issue 8 years ago • 19 comments

Could we support list + children? How would it look?

Spun off from zapier/zapier-platform-cli#114 @ZenCocoon is this how you'd want it to work? A use case here would also help evaluate this in the future.

Definition

...
inputFields: [
  {
    key: "phones",
    label: "Phones",
    list: true,
    children: [
      { key: 'default', label: 'Default' },
      { key: 'home', label: 'Home' },
      { key: 'business', label: 'Business' },
    ]
  },
],
...

Output

...
"phones:" [
  { "default": "123123", "home": "123123", "business": "123123" },
  { "default": "123123", "home": "123123", "business": "123123" }
]

UI

?

BrunoBernardino avatar Jul 28 '17 09:07 BrunoBernardino

@BrunoBernardino here's an example including UI that is more representative of my intentions:

Definition

...
inputFields: [
  {
    key: "phones",
    label: "Phones",
    list: true,
    children: [
      { key: 'label', label: 'Label', placeholder: 'eg: mobile, work, ...' },
      { key: 'phone_number', label: 'Phone Number' },
      {
        key: 'country_code',
        label: 'Country Code',
        placeholder: 'eg: FR',
        helpText: '2 characters country code, following ISO 3166-1 alpha-2.'
      }
    ]
  },
],
...

Output

...
"phones:" [
  { "label": "mobile", "phone_number": "123123", "country_code": "FR" },
  { "label": "work", "phone_number": "456456", "country_code": "US" }
]

UI

http://share.bookingsync.com/352T3t1Q0H2G/Image%202017-07-30%20at%202.05.15%20PM.png

ZenCocoon avatar Jul 30 '17 12:07 ZenCocoon

Awesome @ZenCocoon thank you for this! Makes it much easier to think about how would this be possible.

BrunoBernardino avatar Jul 31 '17 11:07 BrunoBernardino

Actually here, I think all the fields should be required

ZenCocoon avatar Aug 05 '17 08:08 ZenCocoon

+1 for list + children support, I could use this, too!

LukasRos avatar Aug 15 '17 17:08 LukasRos

Thanks @LukasRos, would you mind posting an example for us , or what @ZenCocoon posted is similar to your requirement?

BrunoBernardino avatar Aug 21 '17 13:08 BrunoBernardino

I think his example already captures the requirements.

After chatting on your developer Slack I realized that my current use case is already supported because Zapier automatically turns line items into multiple sets (= a list) of an element with children, so it seems you already support the underlying functionality and it just needs to be made available in the UI in case the user wants to define multiple fields even when they're not based on the trigger input.

LukasRos avatar Aug 22 '17 07:08 LukasRos

+1 for this, our API accepts shopping cart as an array of objects, and it's not entirely clear from the "frontend" which zaps emit "line items" and which don't, so I've ended up having to work around with a bunch of optional fields and some custom code to transmogrify those into an array

jasongill avatar Aug 28 '17 15:08 jasongill

I'd also like this. I've got a set of key/value pairs that could be represented as either list, children('key', 'value'), or maybe something like dict, choices.

brandonbloom avatar Feb 12 '18 16:02 brandonbloom

This would be very much appreciated. +1

RobertWHurst avatar Mar 26 '18 18:03 RobertWHurst

is there any way to add only single object. ? Just like this one.

{
Address:{
 AddressLine1: "",
 AddressLine2: "",
.
.
.
 }
}

jawand avatar May 04 '18 06:05 jawand

Any information about supporting it in the UI?

finom avatar May 17 '18 17:05 finom

Wanted!

nbourdeau avatar May 18 '18 20:05 nbourdeau

+1 Wanted

hrehman200 avatar Jun 08 '18 21:06 hrehman200

+1 Wanted

damiancloud avatar Nov 08 '18 11:11 damiancloud

I'm also looking for this feature. It's a prereq for creating an effective Zapier integration with my SAAS product. What are the chances it's going to be implemented? I've created a pretty hacky zap with multiple list fields but that concept falls short when I try to delete fields in the middle of the list. I've kept from trying to release this integration for the past 3 months due to such a lacking experience.

omanizer avatar Mar 06 '19 22:03 omanizer

I have this schema for fields: `inputFields: [ { key: 'name', label: 'Name', required: true }, { key: 'active', type: 'boolean', label: 'Active', required: true, helpText: 'A boolean value representing whether the customer is active.' }, { key: 'phone', label: 'Phone', helpText: 'The primary phone number of the customer.' }, { key: 'altPhone', label: 'Alt Phone', helpText: 'Alternate phone number.' }, { key: 'fax', label: 'Fax', helpText: ' A string representing the customer's fax number.' }, { key: 'emails', label: 'Emails', list: true, helpText: 'An array of strings representing the customer's email addresses.' }, { key: 'contact', label: 'Contact', helpText: 'The customer's contact name.' }, { key: 'accountNr', label: 'Account Number', helpText: ' The customer's account number.' }, { key: 'resaleNr', label: 'Resale Number', helpText: 'A string representing the resale number.' }, { key: 'statusUpdateViaText', label: 'Status Update Via Text', type: 'boolean', helpText: ' A boolean value indicating whether the customer should get the changes via SMS.' }, { key: 'creditHold', label: 'Credit Hold', type: 'boolean', helpText: 'A boolean value indicating whether the customer is placed on credit hold.' }, { key: 'creditLimit', label: 'Credit Limit', helpText: 'The maximum amount of credit for the customer.' }, { key: 'memo', label: 'Memo', helpText: 'A string representing comments associated with the customer.' }, { key: 'website', label: 'Website', helpText: 'A string representing the customer's website.' }, { key: 'salespersonId', label: 'Salesperson Id', helpText: 'A GUID representing the salesperson id associated with the customer.' }, //Shipping Address { key: "shippingAddress", label: "Shipping Address", children: [ { key: 'name', label: 'Name', helpText: 'Any arbitrary string to identify this address.' }, { key: 'line1', label: 'Line1', helpText: 'Address line 1 (Street address, PO Box, etc.).' }, { key: 'line2', label: 'Line2', helpText: 'Address line 2 (Apartment, suite, unit, building, etc.).' }, { key: 'city', label: 'City', helpText: 'A string representing the city, dDistrict, suburb, tTown or village name.' }, { key: 'state', label: 'State Code', helpText: '2-letter state code.' }, { key: 'zipcode', label: 'Zip Code', helpText: 'ZIP or postal code.' },
{ key: 'country', label: 'Country', helpText: 'The country name.' }, ] }, //Billing Address { key: "billingAddress", label: "Billing Address",
children: [ { key: 'name', label: 'Name', helpText: 'Any arbitrary string to identify this address.' }, { key: 'line1', label: 'Line1', helpText: 'Address line 1 (Street address, PO Box, etc.).' }, { key: 'line2', label: 'Line2', helpText: 'Address line 2 (Apartment, suite, unit, building, etc.).' }, { key: 'city', label: 'City', helpText: 'A string representing the city, dDistrict, suburb, tTown or village name.' }, { key: 'state', label: 'State Code', helpText: '2-letter state code.' }, { key: 'zipcode', label: 'Zip Code', helpText: 'ZIP or postal code.' },
{ key: 'country', label: 'Country', helpText: 'The country name.' }, ] }

  ],`

It's looking like this in UI: screenshot-zapier com-2019 04 29-13-51-32

There are number fields overlapped because of the same key of the child element, but the parent have an different keys.

Is there any way to reuse key inside the childrens.

codetycon avatar Apr 29 '19 08:04 codetycon

Hi folks! Thanks for the all the interest here.

These restrictions are a product decision by the editor team. We'll look into what it would take to change that, but given that it's out of the purview of my team (dev-platform) I don't have any info about if/when this will happen at this time.

Going forward, if folks could 👍the original issue rather than commenting, I'm sure all subscribers would appreciate it. We'll update this thread when we have any new info to share.

xavdid avatar Apr 29 '19 17:04 xavdid

This issue has been copied into our private issue (as PDE-869) tracker. Thanks for the report! We'll update this as we learn more.

zapzap avatar Apr 29 '19 17:04 zapzap

Are these tickets on GitHub not being updated, or is the work still to be done please? We are evaluating Zapier as part of our ISO 27001 on-boarding procedure and noticed there are many tickets (including this one from 2019) and bugs which are still outstanding. Can you please provide some insight into whether bugs are prioritised and whether development is 'active'? Thanks

tommed avatar Feb 28 '25 14:02 tommed