cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Power App and Azure Blob storage

Hi everyone,

 

I am new to Powerapp and am trying to achieve the following:

 

I have a list in SharePoint - On my Power App, when creating a new record in SharePoint, user can choose to upload a file (this piece upload files to the blob.) now I need to write back the path to the uploaded file in my text field of the same record in SharePoint.

 

 This is the code for onSelect when uploading the file:

 

Set(VarAzureFile, AzureBlobStorage.CreateFile("events",AddMediaButton1_1.FileName, AddMediaButton1_1.Media));Collect(collectFlyer, {FN: AddMediaButton1_1.FileName, FL: "https://XXX.blob.core.windows.net" & VarAzureFile.Path, FID: VarAzureFile.Id}); Patch('Central Events', thisItem, collectFlyer.FL);

Reset(AddMediaButton1_1);

 

Issue is in the patch, specifying which record to be uploaded.

 

Can you please help?

 

Thanks,

Sanaz

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Power App and Azure Blob storage

Hi @SanazP ,

Could you please share a bit more about the error message?

Where do you put the formula you provided? Within the "Submit" button? How do you submit a new record into your SP List? Using SubmitForm function or Patch function?

I assume that you submit a new record into your SP List using SubmitForm function, is it true? Based on the formula you provided, I think there is something wrong with it.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

SubmitForm(EditForm1)

set the OnSuccess property of the Edit form (EditForm1) to following:

Set(VarAzureFile, AzureBlobStorage.CreateFile("events", AddMediaButton1_1.FileName, AddMediaButton1_1.Media));
Collect(collectFlyer, {FN: AddMediaButton1_1.FileName, FL: "https://XXX.blob.core.windows.net" & VarAzureFile.Path, FID: VarAzureFile.Id});
// Modify formula as below
Patch(
       'Central Events', 
        EitForm1.LastSubmit, 
        {
           BlobPath: Last(collectFlyer).FL  // BlobPath represents the Text field in your SP List to store blob path to uploaded file
        }
);
Reset(AddMediaButton1_1);

or

Set(VarAzureFile, AzureBlobStorage.CreateFile("events", AddMediaButton1_1.FileName, AddMediaButton1_1.Media));
Collect(collectFlyer, {FN: AddMediaButton1_1.FileName, FL: "https://XXX.blob.core.windows.net" & VarAzureFile.Path, FID: VarAzureFile.Id});
// Modify formula as below
Patch(
       'Central Events', 
        LookUp('Central Events', ID = EitForm1.LastSubmit.ID), 
        {
           BlobPath: Last(collectFlyer).FL  // BlobPath represents the Text field in your SP List to store blob path to uploaded file
        }
);
Reset(AddMediaButton1_1);

Please take a try with above solution, check if the issue is solved.

 

More details about Patch function, please check the following article:

Patch function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Power App and Azure Blob storage

Hi @SanazP ,

Could you please share a bit more about the error message?

Where do you put the formula you provided? Within the "Submit" button? How do you submit a new record into your SP List? Using SubmitForm function or Patch function?

I assume that you submit a new record into your SP List using SubmitForm function, is it true? Based on the formula you provided, I think there is something wrong with it.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

SubmitForm(EditForm1)

set the OnSuccess property of the Edit form (EditForm1) to following:

Set(VarAzureFile, AzureBlobStorage.CreateFile("events", AddMediaButton1_1.FileName, AddMediaButton1_1.Media));
Collect(collectFlyer, {FN: AddMediaButton1_1.FileName, FL: "https://XXX.blob.core.windows.net" & VarAzureFile.Path, FID: VarAzureFile.Id});
// Modify formula as below
Patch(
       'Central Events', 
        EitForm1.LastSubmit, 
        {
           BlobPath: Last(collectFlyer).FL  // BlobPath represents the Text field in your SP List to store blob path to uploaded file
        }
);
Reset(AddMediaButton1_1);

or

Set(VarAzureFile, AzureBlobStorage.CreateFile("events", AddMediaButton1_1.FileName, AddMediaButton1_1.Media));
Collect(collectFlyer, {FN: AddMediaButton1_1.FileName, FL: "https://XXX.blob.core.windows.net" & VarAzureFile.Path, FID: VarAzureFile.Id});
// Modify formula as below
Patch(
       'Central Events', 
        LookUp('Central Events', ID = EitForm1.LastSubmit.ID), 
        {
           BlobPath: Last(collectFlyer).FL  // BlobPath represents the Text field in your SP List to store blob path to uploaded file
        }
);
Reset(AddMediaButton1_1);

Please take a try with above solution, check if the issue is solved.

 

More details about Patch function, please check the following article:

Patch function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Power App and Azure Blob storage

Hi Kris,

 

Thank you for your solution.

 

The formula was onSelect for the upload file to blob. I modified it and omitted the patch function. Then on the submit form, I added the patch formula to update it with the last item uploaded to the blob.

 

Thank you very much. 

Sanaz

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,550)