Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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?

  • Community Power Platform Member Profile Picture
    on at
    Re: Enable pickFile to work in harness

    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

     

     

     

     

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at
    Re: Enable pickFile to work in harness

    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.

  • v-siky-msft Profile Picture
    on at
    Re: Enable pickFile to work in harness

    Hi @OOlashyn ,

     

    Could you please share more about your scenario?

    Some screenshots or code would be better to help you.

    Best regards,

    Sik

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard