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 / Upload a file to a Sha...
Power Apps
Answered

Upload a file to a SharePoint document library

(0) ShareShare
ReportReport
Posted on by 26

Hello,

 

What is explained in this video is something i also want to make but i run into a problem. The variables are not recognized. However, when I use a ";" instead of "," in the first line, that goes well. But then I can't use the second 'Set". It will not be recognized.

 

First Line
So when i use this code "Set(varAttachmentControl; JSON(Image1.Image;IncludeBinaryData))" it works.

But when i use "Set(varAttachmentControl, JSON(Image1.Image;IncludeBinaryData))" it doesnt work.

 

I also have problems with the second line which is shown from 05.00 it the video. That line does not work with me. The variable and al the other commands are not recognized.

 

Does anyone have an idea how i can solve this?

Categories:
  • Masino Profile Picture
    321 on at

    Just replace the "," with ";" .
    It depends on your area.
    For the second line of code, same answer! Replace all the "," with ";".

     

    You can read more here --> PowerApps upload file to SharePoint document library - SPGuides

     

    Have a nice day

  • Durk Profile Picture
    26 on at

    Thx, @Masino , i follow now the steps in your link. I then get a problem with colAttachmentGallery . It does not regognize the code like in this screen.

    Power app.png

     

     

     

  • Masino Profile Picture
    321 on at

    What error do you get?

  • Durk Profile Picture
    26 on at

    The name is invalid. colAttachmentGallery not recognized

    and

    The function Clear only has invalid arguments

  • Masino Profile Picture
    321 on at

    OnSelect = Clear(colAttachmentGallery); ForAll( Gallery1.AllItems; Collect( colAttachmentGallery; { Title: lblTitle.Text, DataStream: imgDataStream.Image } ) );

    Try this one

  • Durk Profile Picture
    26 on at

    Still get the same errors

  • Masino Profile Picture
    321 on at

    have you checked the names ? it sound strange, it's working to me

  • Durk Profile Picture
    26 on at

    checked all the names. Gallery1, lblTitle and imgDataStream are correct. The names are the same as in the instructions. When i go to collection there is no colAttachmentGallery so i think the problem is something there?

    There is only one collection named attachColelction

  • Masino Profile Picture
    321 on at

    You can see only one collection becouse this one, colAttachmentGalley , has not been created yet.
    This is happening becouse your info inside the collection are not valid.
    Is the image name exactly  "imgDataStream", and the text field "lblTitle" ?


    Just in case, can you provide a screenschot of your  app with the field selected?

  • Durk Profile Picture
    26 on at

    PAP.jpg

    I checked again. See screenshot. I see no difference.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard