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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help for File att...
Power Apps
Answered

Need help for File attachment to Share point document library from power apps

(0) ShareShare
ReportReport
Posted on by 6

Hi,

 

need help for File attachment to Share point document library from power apps. I have 2 separate attachment control in power apps to attach the file.

when I'm attaching the file for both the attachment control its working fine, but when attaching the file for one and another one leaving blank is getting an error as Invalid type. Expected string but got Null

 

using below code 

 

Test_upload.Run(
{
file: {
name: Coalesce(First(Attachment_1.Attachments).Name, " "),
contentBytes: Coalesce(First(Attachment_1.Attachments).Value," ")

},
file_1: {
name: Coalesce(First(Attachment_2.Attachments).Name, " "),
contentBytes: Coalesce(First(Attachment_2.Attachments).Value," ")

}

}
);

Ashutosh191_1-1699971256055.png

 

Ashutosh191_0-1699971087638.png

@mdevaney please see if you can help on this

 

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Ashutosh191 

    As test it in my side , when i use your code in Power Apps and we do not put the Attachments in one of the control.

    Even though we use the Coalesce() function to avoid the null value , the Power Automate still get the null in the "

    contentBytes" field.
    vyueyunmsft_0-1700013460258.png

    So controlling null values here in Power Apps doesn't seem to work. This should be your error in Power Automate, and you need to add a Condition verdict in Power Automate that will either prohibit the null value from being executed to the next step, or filter to prevent null from being passed to the next step.

     

    You can also check your Power Automate's run historty to see where the issue is occurring for troubleshooting.

     


    Best Regards,

    Yueyun Zhang

  • Ashutosh191 Profile Picture
    6 on at

    Hi @v-yueyun-msft 

     

    Thank you for your reply.

    for me the Power Automate flow is not at all triggering if any of the attachment control is keeping as blank and submitting on power apps.

     

    Regards,

    Ashutosh

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Ashutosh191 

    Thanks for your quick response! Do you mean you configure the power automate trigger condition in your side ?
    And as the screenshot , you are using the Power Apps V2 trigger. And i use your code in my Power Apps , there is no error code and it can pass the parameter to the flow.

    So , is there any error code in your flow run history ?

     

     

     

     

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you.


    Best Regards,

    Yueyun Zhang

     

     

  • Ashutosh191 Profile Picture
    6 on at

    Disabled the option "Formula level error management" in Setting has resolved the issue. 

     

    Ashutosh191_0-1700130160537.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard