web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sending multiple optio...
Power Apps
Suggested Answer

Sending multiple optional files to Automate

(2) ShareShare
ReportReport
Posted on by 7
Hello friends. 
 
I have this situation, I need to edit a row on my Sharepoint List and send the data to Power Automate. 
I also have a Document Library where I save all the files related to that edited row. 
 
So the thing is: I don't need to upload again all the files everytime I need to edit the row. 

These are the cases: 
 
File 1 File 2 File 3
Empty Empty Empty
Not empty Empty Empty
Empty Not empty Empty
Empty Empty Not empty
... ... ...
Not empty Not empty Not empty
 
2= 8 cases. 

The thing is, I can't seem to find a way to get the right code. 

I tried this code, but it doesn't work.
 
    aprobacionEditarExternos080125.Run(
        {
            text: JSON(varObjeto);
            file: If(
                !IsBlank(attachCV_1.Attachments);
                {
                    name: Last(attachCV_1.Attachments).Name;
                    contentBytes: Last(attachCV_1.Attachments).Value
                };
                Blank()
            );
            file_1: If(
                !IsBlank(attachCertificado_1.Attachments);
                {
                    name: Last(attachCertificado_1.Attachments).Name;
                    contentBytes: Last(attachCertificado_1.Attachments).Value
                };
                Blank()
            );
            file_2: If(
                !IsBlank(attachTercer_1.Attachments);
                {
                    name: Last(attachTercer_1.Attachments).Name;
                    contentBytes: Last(attachTercer_1.Attachments).Value
                };
                Blank()
            )
        }
    )


It sends "Blank" and I need it to send nothing! 

I don't want to write 8 "If" codes... 

Do you guys know how to send multiple optional files? 

varJson and the 3 files parameters are optional on Power Automate. 

Please help! 

Thank you :-) 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    For the attachments that don't exist you need to send a record with a value of null.  Try something like this
     
    file: If(
                    !IsBlank(attachCV_1.Attachments);
                    {
                        name: Last(attachCV_1.Attachments).Name;
                        contentBytes: Last(attachCV_1.Attachments).Value
                    };
                    null
                );
     

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • JC-07101246-0 Profile Picture
    7 on at
    @Pstork1 thank you for your answer. 
     


    Null is not an option for me. It is not recogniced 
     
     
                file: If(
                    !IsBlank(attachCV_1.Attachments);
                    {
                        name: Last(attachCV_1.Attachments).Name;
                        contentBytes: Last(attachCV_1.Attachments).Value
                    };
                    null
                );
     
     
    I tried these codes too... It didn't work either. 
     
    Using ""  :
     
                file: If(
                    !IsBlank(attachCV_1.Attachments);
                    {
                        name: Last(attachCV_1.Attachments).Name;
                        contentBytes: Last(attachCV_1.Attachments).Value
                    };
                    {
                        name: "";
                        contentBytes: ""
                    }
                )
     
     
     
    Using Blank()
                file: If(
                    !IsBlank(attachCV_1.Attachments);
                    {
                        name: Last(attachCV_1.Attachments).Name;
                        contentBytes: Last(attachCV_1.Attachments).Value
                    };
                    {
                        name: Blank();
                        contentBytes: Blank()
                    }
                )
     
     
    Each field is defined as optional. 

    So I don't know what's wrong :-( 
     
  • Suggested answer
    JC-07101246-0 Profile Picture
    7 on at
    I ended writing the 8 cases inside an If function... 
     
    I don't know what I'll do if I have to change 4 or more files... 

    24= 16
    25= 32
    26= 64

     
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    You can't just use Null.  It has to be used as a value in a record. So it should be something like.
    file: If(
                    !IsBlank(attachCV_1.Attachments);
                    {
                        name: Last(attachCV_1.Attachments).Name;
                        contentBytes: Last(attachCV_1.Attachments).Value
                    };
                    {name: null; contentBytes: null};
                );

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard