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 / Enable pickFile to wor...
Power Apps
Unanswered

Enable pickFile to work in harness

(0) ShareShare
ReportReport
Posted on by 3,496 Most Valuable Professional

Hi All,

 

I noticed that pickFile method from context.device doesn't work in harness (or more specifically always returns undefined). Any estimates when it will be enabled to use in harness?

I have the same question (0)
  • v-siky-msft Profile Picture
    on at

    Hi @OOlashyn ,

     

    Could you please share more about your scenario?

    Some screenshots or code would be better to help you.

    Best regards,

    Sik

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    Hi @v-siky-msft ,

    Sure, I created a button and on button click, I trigger function that should obtain the file. Inside the function, I am just using context.device.pickFile and it always executes successfully and returns undefined as a result.

    this._pickFileBtn = document.createElement('button');
    this._pickFileBtn.innerText = "Select Audio";
    this._pickFileBtn.onclick = () => this.getAudioFile();
    
    private getAudioFile() {
    	this._context.device.pickFile().then(
    		(result) => this.setAudioFile(result),
    		(e) => console.error("Error occured:", e)
    	);
    }

    context.device.pickFile works fine when I use it in real environment.

     

    I checked out how context.device.pickFile is executed in harness and can see that it return Promise with undefined value under the hood.

  • Community Power Platform Member Profile Picture
    on at

    I have this code but doesn't work, you know what I'm wrong?

     

    1. This is how I create the button and add the onclick event:

    ltorres_0-1648875316403.png

    2. This is the openFilesBrowser func:

    ltorres_1-1648875371210.png

     

    3. And this is the getConvertedFile:

    ltorres_2-1648875408786.png

     

    And when I click the button it doesn't open the browser and send me this error:

    ltorres_3-1648875503113.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

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard