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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,217)