Hi!
I'm quite new to Power Automate and I've hit a roadblock building a relatively simple flow.
What I'm trying to do: When I press a button in Excel online, send an e-mail based upon the selected row.
At a basic level I set it up successfully, but it starts failing when I add some dynamic content into the e-mail body. Through trial and error I've narrowed the problem down to my fields that contain numbers, which makes sense based on the error message:
The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Invalid type. Expected String but got Integer.'.
So I've basically gone down a rabbit hole trying to determine how I can change the numbers in my excel file into the string format so the flow will accept the dynamic content.
What I've tried..
- Changing the excel table cells from "general" or "number" formats to "Text"
- In the E-mail action, I tried going to the Expression area of the dynamic content, typing 'string( )', and inserting the dynamic content between the parentheses, but the dynamic content doesn't appear like it normally does. This prompted me to try a couple of things..
- Peeking at the e-mail code to grab the formatting when the dynamic content was inserted - outcome was basically: '@{string(triggerBody()?['entity']?['Project Line ID(s)'])}' - This actually "worked" in the sense that the flow no longer failed, but the field did not come through at all. In other words, where I was expecting the number to appear in the test e-mail, the content was blank.
- I also tried initializing a variable earlier in the flow to grab the dynamic content and then using the compose action with either 1) the string expression or 2) the format number expression to try and force the integer to convert to a string. Then, I inserted the output of those expressions into the e-mail action (instead of the original dynamic content)
- Similar to #2 above, I've tried the "get a row" action to.. silly I know.. get the same row from the excel document I'm already referencing. Somehow this bypasses my earlier problem of the "Project Line ID" dynamic content not showing up when I use the string expression. I'm not sure if this would even work, but this seems to cause another issue. I've noticed that when I initiate this "get a row" action, even if I remove the integer dynamic content from the e-mail body, I get the same error message.
I've watched probably a dozen YouTube tutorials and scoured sites like these and I can't seem to find anyone with my exact problem so I'm at the limit of my understanding and knowledge. Would appreciate anyone's help to troubleshoot/resolve the issue.