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

Submit to sharepoint button formula problem

I have a button that is suppose to submit to a PowerAutomate workflow. It is sending values to a PowerAppsV2 workflow. One of the values is an optional text field. This is also submitting an attachment to a sharepoint document library and updating some meta data. When I changed it from required to optional, the run formula changed from 'Upload'.Run(Text, Text_1, Text_2, {file:Record}) to this 'Upload'.Run(Text, Text_2, {text:Text, File:Record}. I can't figure out how to enter this information correctly. Here it was originally 'Upload'.run(Title.Text, ISNum.Text, Comments.Text, contentBytes: First(Attachment.Attachments).Value, Name: First(Attachment.Attachments).Name})

 

I have tried this as the new value, but it isn't accepting this as a formula.

'Upload'.run(Title.Text, Comments.Text {ISNum.Text, contentBytes: First(Attachment.Attachments).Value, Name: First(Attachment.Attachments).Name}})

Any idea on how to fix this? and why this keeps happening when I make a text field optional?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
iwannabfishn
Frequent Visitor

So, I did find the answer to this question. It was consistent. When a text field is made optional, the run formula puts it in the curly brackets like this. This is the formula that is working.

'Upload'.run(Title.Text, Comments.Text, {text:ISNum.Text, contentBytes: First(Attachment.Attachments).Value, Name: First(Attachment.Attachments).Name})

If I change the ISNum field to be mandatory the formula will move it outside the curly brackets. Weird but this is what works.

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @iwannabfishn ,

 

Could you please show me your flow?

 

Best Regards,

Bof

iwannabfishn
Frequent Visitor

So, I did find the answer to this question. It was consistent. When a text field is made optional, the run formula puts it in the curly brackets like this. This is the formula that is working.

'Upload'.run(Title.Text, Comments.Text, {text:ISNum.Text, contentBytes: First(Attachment.Attachments).Value, Name: First(Attachment.Attachments).Name})

If I change the ISNum field to be mandatory the formula will move it outside the curly brackets. Weird but this is what works.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,202)