Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Add Attachment Data Card and Enhance Patch Function to Handle Attachments in Power Apps #3585

Open
mateusperes15 opened this issue Jul 15, 2024 · 0 comments

Comments

@mateusperes15
Copy link

mateusperes15 commented Jul 15, 2024

Type of Connector

Certified Connector

Name of Connector

Function Patch

Is your feature request related to a problem? Please describe.

Attaching a file and uploading this data in Power Apps is currently a cumbersome process with two main workarounds:

  1. Using Power Automate:

    • Create a form to access the attachment data card, copy it, and paste it outside the form, then delete the form.
    • Use the Patch function to create a new record and store the ID in a variable.
    • Call a Power Automate flow, passing the file in a document variable and referencing the ID to store the attachment in the correct list item.

    For example:

    Set(VarID;
    Patch(List;
    Defaults(List);
    {
    Name: Mateus;
    Age: 18
    }
    ).ID);;
    Upload_PDF.Run(VarID;{file:{contentBytes:First(DataCard1.Attachments).Value;name: First(PDF.Attachments).Name}})

  2. Without Using Power Automate:

    • Create a form and keep only the attachment data card.
    • Use the Patch function to create a new record, then use Form.Updates to handle the attachment upload directly.

    For example:

  3. Create a Form (Name: Form1)

  4. Put the list in Item

  5. I only leave the data card attachment.

  6. Make the normal Patch and place Form1.Updates at the end

Patch(List;
Defaults(List);
{
Name: Mateus;
Age: 18
};
Form1.Updates
)

Both methods are complex and involve unnecessary steps.

Describe the solution you'd like

Suggested Improvement:

  1. Develop a standalone attachment data card that can be added directly to a data entry form without needing to copy from an edit form.

  2. Adapt the Patch function to handle attachments directly from this data card, eliminating the need for Power Automate in simple scenarios. For example:

    PowerApps
    Patch(
    Lista,
    Default(Lista),
    {
    Nome: "Mateus",
    Idade: 20,
    Sexo: "Masculino"
    },
    NewDataCard.Attachments
    )

Instead of referencing the ".updates" form, simply enter the NewDataCard.attachamments data input and the patch will create the file with the appended content and the appended file name

Describe alternatives you've considered

Currently, I need to create an edit form, copy the default attachment data card, and paste it on a blank page, then delete the form because it’s the only way to get this data card. Alternatively, I create a form, keep only the attachment data card, and use Form.Updates at the end of the Patch function.

Additional context

Benefits:

  • Simplifies the process of attaching and uploading files.
  • Reduces the need for additional Power Automate flows.
  • Enhances user experience by providing a more integrated solution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant