verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
96 stars 72 forks source link

Have a webhook send an image url when the file upload field is in a repeater field. #1666

Closed bfjare closed 9 months ago

bfjare commented 10 months ago

What are you trying to do?

Trying to have after a form upload with images that have titles and descriptions for each upload into dropbox with zapier.

What's your proposed solution?

Currently the image url is not in the webhook when its inside a repeater field.

Additional context

No response

engram-design commented 10 months ago

What version are you on? Here's an example payload for me (removed some properties for brevity):

[
    "submission" => [
        "id" => 15441,
        "formId" => 15437,

        // ...

        "repeater" => [
            [
                "file" => [
                    [
                        "alt" => null,
                        "archived" => false,

                        // ...

                        "url" => "https://formie.test/uploads/test/CleanShot-2023-10-26-at-12.43.50.png",
                        "validatingRelatedElement" => false,
                    ]
                ]
            ]
        ]
    ]
]
bfjare commented 10 months ago

Thanks Josh,

Here are the versions

Craft CMS PRO PRO EDITION  3.9.6

Formie: 1.6.36.1

Here is the response payload I am getting. { "submission": { "id": 39447, "formId": "39417", "userId": null, "ipAddress": null, "isIncomplete": "0", "isSpam": "0", "spamReason": null, "title": "2023-12-20 12:56:43", "dateCreated": "2023-12-20T12:56:42-07:00", "dateUpdated": "2023-12-20T12:56:42-07:00", "dateDeleted": null, "trashed": false, "status": "new", "name1": "Ben Fjare", "email": @.***", "location": { "label": "Ennis RV Park by Starry Night Lodging", "value": "Ennis RV Park by Starry Night Lodging", "selected": true, "valid": true }, "images": [ { "image": [ { "isFolder": false, "sourcePath": null, "folderId": "88", "uploaderId": "1", "folderPath": "form-uploads/Dec-20-2023/", "filename": "iStock-1318478175.jpg", "kind": "image", "size": "3072816", "keptFile": null, "dateModified": { "date": "2023-12-20 12:56:43.000000", "timezone_type": 3, "timezone": "America/Denver" }, "newLocation": null, "locationError": null, "newFilename": null, "newFolderId": null, "tempFilePath": null, "avoidFilenameConflicts": false, "suggestedFilename": null, "conflictingFilename": null, "deletedWithVolume": false, "keepFileOnDelete": false, "id": 39449, "tempId": null, "draftId": null, "revisionId": null, "isProvisionalDraft": false, "uid": "3dfb5e32-7ac4-4d15-8077-d52111a4a863", "siteSettingsId": 39449, "fieldLayoutId": 89, "structureId": null, "contentId": 8787, "enabled": true, "archived": false, "siteId": 1, "title": "I Stock 1318478175", "slug": null, "uri": null, "dateCreated": { "date": "2023-12-20 12:56:43.000000", "timezone_type": 3, "timezone": "America/Denver" }, "dateUpdated": { "date": "2023-12-20 12:56:43.000000", "timezone_type": 3, "timezone": "America/Denver" }, "dateLastMerged": null, "dateDeleted": null, "root": null, "lft": null, "rgt": null, "level": null, "searchScore": null, "trashed": false, "awaitingFieldValues": false, "propagating": false, "propagateAll": false, "newSiteIds": [], "isNewForSite": false, "resaving": false, "duplicateOf": null, "firstSave": false, "mergingCanonicalChanges": false, "updatingFromDerivative": false, "previewing": false, "hardDelete": false } ], "title1": "test", "description": "red" } ] }, "form": { "settings": { "displayFormTitle": "", "displayCurrentPageTitle": "", "displayPageTabs": "", "displayPageProgress": "", "scrollToTop": "1", "progressPosition": "end", "defaultLabelPosition": "verbb\formie\positions\AboveInput", "defaultInstructionsPosition": "verbb\formie\positions\AboveInput", "submitMethod": "page-reload", "submitAction": "message", "submitActionTab": null, "submitActionUrl": "", "submitActionFormHide": "", "submitActionMessage": "[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Submission saved.\"}]}]", "submitActionMessageTimeout": "", "submitActionMessagePosition": "top-form", "loadingIndicator": "", "loadingIndicatorText": "", "validationOnSubmit": "1", "validationOnFocus": "", "errorMessage": "[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Couldn’t save submission due to errors.\"}]}]", "errorMessagePosition": "top-form", "availabilityMessage": null, "availabilityMessageDate": null, "availabilityMessageSubmissions": null, "submissionTitleFormat": "{timestamp}", "collectIp": "", "collectUser": "", "dataRetention": null, "dataRetentionValue": null, "fileUploadsAction": null, "redirectUrl": null, "defaultEmailTemplateId": "", "disableCaptchas": false, "storeData": null, "userDeletedAction": null }, "handle": "imageUploadForm", "oldHandle": null, "fieldContentTable": "{{%fmc_imageuploadform}}", "templateId": null, "submitActionEntryId": null, "requireUser": "0", "availability": "always", "availabilityFrom": null, "availabilityTo": null, "availabilitySubmissions": null, "defaultStatusId": "1", "dataRetention": "forever", "dataRetentionValue": null, "userDeletedAction": "retain", "fileUploadsAction": "retain", "fieldLayoutId": 87, "id": 39417, "tempId": null, "draftId": null, "revisionId": null, "isProvisionalDraft": false, "uid": "f658dfd1-03d0-4cbe-8bd8-19281cb45362", "siteSettingsId": 39417, "contentId": 8775, "enabled": true, "archived": false, "siteId": 1, "title": "Image Upload Form", "slug": null, "uri": null, "dateCreated": { "date": "2023-12-19 12:19:07.000000", "timezone_type": 3, "timezone": "America/Denver" }, "dateUpdated": { "date": "2023-12-20 12:56:11.000000", "timezone_type": 3, "timezone": "America/Denver" }, "dateLastMerged": null, "dateDeleted": null, "trashed": false, "isNewForSite": false, "canonicalId": 39417, "ref": null, "status": "enabled", "structureId": null, "url": null } }

Ben Fjare Principal, Director of Digital Development, Prime Incorporated 406.930.7575 | primebzn.com | @. 810 N Wallace Ave. Ste D | Bozeman MT | 59715 On Dec 19, 2023 at 4:14 PM -0700, Josh Crawford @.>, wrote:

What version are you on? Here's an example payload for me (removed some properties for brevity): [ "submission" => [ "id" => 15441, "formId" => 15437,

   // ...

   "repeater" => [
       [
           "file" => [
               [
                   "alt" => null,
                   "archived" => false,

                   // ...

                   "url" => "https://formie.test/uploads/test/CleanShot-2023-10-26-at-12.43.50.png",
                   "validatingRelatedElement" => false,
               ]
           ]
       ]
   ]

] ] — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

engram-design commented 10 months ago

So I can see images > image > uri is null but there's no url attribute. Can you comment on your volume settings? Does the volume have public URLs enabled?