cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Level 8

MS Word Connector

I hope someone could point me in the right direction.

 

 

I have followed ther instructions in thet bellow video and I did a test sample and it works great, now I have to change the trigger option form manual trigger to “ask in powerapps”

 

I would like to have a button in my powerapps that when the user click in that button it does the same action “Save a PDF and send the pdf to my email form the word template. “based in the selected item in my gallery.

 

But I can not get this to work. BTW the item selected in my gallery is a Share Point item.

 

Any help?

 

Thanks in advance,

 

 

https://www.youtube.com/watch?v=Zzm965PlYl0

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: MS Word Connector

Something like that, but I would use a 'Get Item' action instead of a 'Get Items' action.  Then create a parameter to pass the itemID from PowerApps.  YOu can use that to get a single item from SharePoint.

screenshot.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

30 REPLIES 30
Dual Super User
Dual Super User

Re: MS Word Connector

In the video they create inputs on the button for the strings that will be used to fill in the template.  In your instance you want to use a SharePoint List item.  So what you want to create an ask in Powerapps field for in the Flow is the Item Id of the SharePoint item.  Then add a Get Item action right after the Trigger in the Flow and retrieve the SharePoint Item whose ID you passed to the Flow. Now you can use the metadat fields in the SharePoint item in place of the Input fields from the Button in the video.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

Thank you very much for your prompt response.

 

You mean something like this?

 

Capture1.PNGCapture2.PNG

Dual Super User
Dual Super User

Re: MS Word Connector

Something like that, but I would use a 'Get Item' action instead of a 'Get Items' action.  Then create a parameter to pass the itemID from PowerApps.  YOu can use that to get a single item from SharePoint.

screenshot.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

sajarac
Level 8

Re: MS Word Connector

Thank again for your prompt response, almost done. I hev changed to "Get Item"

 

But I don't know hot to pass from Powerapps.

 

Picture1.png

Dual Super User
Dual Super User

Re: MS Word Connector

In the Flow go to the Get Item action and in teh ID field insert the dynamic content "Ask in PowerApps".  That will create a parameter that you can pass in the Flow.Run(ItemID) statement from PowerApps.  Take the selected record in PowerApps, get the ID and pass that to Flow.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

Sorry, please forgive me.

 

I think that I did the first part:

 

Capture1.PNGAnd this is the formule used in my button inside my gallery:

 

Capture2.PNG

Dual Super User
Dual Super User

Re: MS Word Connector

That all looks right.  Since you added the parameter after you added the Flow to PowerApps you may have to remove it in PowerApps and re-add it to pick up that there is a parameter.  That's probably why you are getting the error squiggle under the Run command in PowerApps.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

Great!

 

I think is done, I am geting an error but is related to the MS Word document.

But the flow is working fine no errors....Yesss!!

🙂

 

"status": 400,
"message": "The selected file doesn't contain template elements.\r\nclientRequestId
Dual Super User
Dual Super User

Re: MS Word Connector

Can you provide a screenshot of your Populate a Word template action?  The error sounds like you didn't put any fields in the Word document you are using for a Template.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

Capture.PNG

sajarac
Level 8

Re: MS Word Connector

The selected file doesn't contain template elements.

Dual Super User
Dual Super User

Re: MS Word Connector

The fields like matching, and NameLast should be the template fields.  Not sure why you are seeing the errror.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

Thank you very much, I have it working fine now. As you can see in previous screen the word fields were empty.

 

I just completed required information.

 

Much appreciated.

 

🙂

sajarac
Level 8

Re: MS Word Connector

Hi there, sorry to bother you again. I have a quick question and it seems like you are the only person here able to help.

 

I have everything working fine with my MS word connector thaks to your help!!

 

But once the file is merged I am getiing in my word file my numbers with a lot of decimals or zeros, I know that you can do right click and select "Edit field" but is seems like this option is not available for this kind of controls.

 

Any advice?

 

I would like to implement Decimal separator and currencly symbol

Capture.PNG

Dual Super User
Dual Super User

Re: MS Word Connector

Use the built-in Flow functions to format the fields appropriately when you insert them into the fields for the template.  The fields in Word are basically just fill in the blank string fields.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

Thanks again, do you have any sample that you can attach? I just need a field example and I will replicate the rest.

 

Regards,

 

 

Dual Super User
Dual Super User

Re: MS Word Connector

Looks like I'm wrong.  The functions I'm remembering are available in PowerApps but not in Flow.  In PowerApps you use the Text() function, but this isn't available in Flow.  You can format DateTime values, but not numbers.

 

The only workaround I can come up with is to convert the number to a string and then use substring to get just the number up to two decimal places.  something like this.

substring(string(variables('number')),0,Add(IndexOf(string(variables('number')),'.'),3))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
sajarac
Level 8

Re: MS Word Connector

It seems like is easy, so I google it how to do it and I get this result.....OMG this is for a MS Flow Guru, not for a newbie.

 

https://powerusers.microsoft.com/t5/Building-Flows/How-to-convert-array-item-from-number-to-string/t...

 

 

Dual Super User
Dual Super User

Re: MS Word Connector

The complexity there is because they are working with an Array, not just converting a number to a string.  That conversion is easy, its

string(variables('number'))

But that doesn't let you format the string in terms of # of decimal places or anything.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,910)