cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

dataUri

I am encountering a problem while trying to run a flow in a powerapp built to upload a pic(.jpg) to SP. my method is the DataUriToBinary.

Within Flow

  • I create blank flow,
  • add a power apps trigger,
  • add a sharepoint create file action (set the correct SP site url, folder path, file name-I pick ask in Pwrapps, for file content- i do the dataUri wrap: dataUriToBinary(triggerBody()['CreatefileFileContent'])
  • add sharepoint update file properties action (set correct SP url, pick the correct library, set id:ItemId)

I swear this method has worked this week.. But everytime I try to run it now it fails on the createfile flow step. Heck, it worked once today and has crapped out ever since. TGIF..

It seems that flow is unable to create a createfile_FileContent variable from the dataUri expression. (I realize there is an underscore there, I have tried it every way but the correct way) This is beyond frustrating. SOS.

Thanks in advance!

 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

I think I have figured out the cause of the flow failure. 

I will try to show you what i mean without causing confusion. Notice below, the Context Variable (hopefully that's what it's called) named "Createfile_FileName" underlined in red. This variable is created and becomes visible when I select "Ask in PowerApps" for filename.

 

In the 2nd image, no context variable was created if I just type the dataUri expression directly in. And if I do that, PowerApps gives me an unusual request for the flow syntax. I didn't get a screen shot of that yet, but the flow under these circumstances does not "createfilefilecontent" causing this flow to fail.

 

The workaround I have uncovered is to click "ask in powerapps" in the file content field, then delete what you just added in the field. Go back into the field and enter dataUriToBinary(triggerBody()['CreatefileFileContent']) in the expression box.

 

with an underscore between file_File 

dataUriToBinary(triggerBody()['Createfile_FileContent'])

 

The context variable has now been created (with the deletion of the "Ask in powerapps" from the file content field) and can now effectively recognize the synatx of the dataUri request.

 

I really hope this makes more sense.. 

sc1.pngsc2.png

sc3.pngsc4.png

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Hi @mmmcoffeegood,

 

Could you please share a screenshot of the configuration of your flow?

Could you please share more details about the error message?

 

Please share more details so we would try to provide a proper workaround for you.

 

Best regards,

Alice

Highlighted

I think I have figured out the cause of the flow failure. 

I will try to show you what i mean without causing confusion. Notice below, the Context Variable (hopefully that's what it's called) named "Createfile_FileName" underlined in red. This variable is created and becomes visible when I select "Ask in PowerApps" for filename.

 

In the 2nd image, no context variable was created if I just type the dataUri expression directly in. And if I do that, PowerApps gives me an unusual request for the flow syntax. I didn't get a screen shot of that yet, but the flow under these circumstances does not "createfilefilecontent" causing this flow to fail.

 

The workaround I have uncovered is to click "ask in powerapps" in the file content field, then delete what you just added in the field. Go back into the field and enter dataUriToBinary(triggerBody()['CreatefileFileContent']) in the expression box.

 

with an underscore between file_File 

dataUriToBinary(triggerBody()['Createfile_FileContent'])

 

The context variable has now been created (with the deletion of the "Ask in powerapps" from the file content field) and can now effectively recognize the synatx of the dataUri request.

 

I really hope this makes more sense.. 

sc1.pngsc2.png

sc3.pngsc4.png

View solution in original post

Highlighted

sc5.png

The only way I can get the Createfile_FileContent syntax to appear as underlined above is in flow to click "Ask in powerapps" then delete it out and type in the dataUri expression. Only then will powerapps actually create the file content in the sharepoint list.

Highlighted
Anonymous
Not applicable

Spoiler
Error Code 502

Hi , Microsoft Teams.

 

I Just get an error from button submit which triggered  save data to collection and manual upload from powerapps to sharepoint.

The error specifically like this :

 

UploadRequestDocument.Run gagal: { "error": { "code": 502, "source": "asia-001.azure-apim.net", "clientRequestId": "54fc2f9e-9197-4b06-8440-a53d72485936", "message": "BadGateway", "innerError": { "error": { "code": "NoResponse", "message": "The server did not received a response from an upstream server. Request tracking id '08586323778431590243324131115CU12'." } } } }

 

What did i do wrong?

Please kindly help.

 

Thank you so much.

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (7,923)