cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Concat function has invalid arguments

Im new here and trying to post for help.. Below is my code and Im getting an error that states that the "The function Concat has some invalid arguments".. What makes the arguments invalid?

 

office365Outlook.SendEmail("somebody@outlook.com", "New Ticket", Concat(Incident, "Name: " & Name & Char(10) & "Phone: " & Phone & Char(10) & "Email: " & Email & Char(10) & "Category: " & Category & Char(10) & "Impact: " & Impact & Char(10) & "Short Description: " & 'Short Description' & Char(10) & "Full Description: " & 'Full Description' & Char(10)))

 

This code is attached to an "Email" button in a form, that when pressed should send out..

Name:

Phone:

Email:

Impact:

Short Description:

Full Description:

13 REPLIES 13
mdevaney
Super User
Super User

@Anonymous 

Are all of your fields single-line text?  If you are using a Choice column type for category you would need to add .Value as shown below.  Is also suggest <br> tags when writing an email body since it is HTML.

Office365Outlook.SendEmail(
    "somebody@outlook.com",
    "New Ticket",
    Concat(Incident,
        "
        Name: " & Name & "<br>
        Phone: " & Phone & "<br>
        Email: " & Email & "<br>
        Category: " & Category.Value & "<br>
        Impact: " & Impact & "<br>
        Short Description: " & 'Short Description' & "<br>
        Full Description: " & 'Full Description'
    )
)

 

The best way to figure out which argument is causing the problem is to remove them one-by-one.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Anonymous
Not applicable

Still getting the same error. Category but I do understand the response.. Category has drop down content and so does "Impact".. I get the same error, even if I use just one argument and I not sure why.. eg: Concat(Incident, "Name: " & Name & Char(10))

@Anonymous 

Can you take a screenshot of some data in the Incident datasource/collection?

Anonymous
Not applicable

There is no collection or links.. Its a simple form that the user fills in, and once the click Submit, it should email the contents of the form.. This should be a simple undertaking but Im not sure whats causing the issue.

Anonymous
Not applicable

also, I went back in and removed the "Match." value from the arguments.

@Anonymous 

Please show a screenshot without the MATCH present.


Also, can you share what Incidents looks like?

 

Anonymous
Not applicable

I have taken out all of the arguments except one and am still getting the same error. The form itself is called incident and its a really simple form. I just need to have the contents of the form emailed after its filled out... There are no associated collections. 

@Anonymous 

Incident is definitely the problem.  You cannot reference 'Incident' in the CONCAT formula because it is not a Table: it is a form.  After the form is submitted successfully you can use Incident.LastSubmit to retrieve a Table of values and place it in CONCAT.

 

You can try this code in the OnSuccess property of the form.

Office365Outlook.SendEmail(
    "somebody@outlook.com",
    "New Ticket",
    Concat(Incident.LastSubmit,
        "
        Name: " & Name & "<br>
        Phone: " & Phone & "<br>
        Email: " & Email & "<br>
        Category: " & Category.Value & "<br>
        Impact: " & Impact & "<br>
        Short Description: " & 'Short Description' & "<br>
        Full Description: " & 'Full Description'
    )
)
Anonymous
Not applicable

I understand your answer and but am unable to impliment the solution. There is no OnSuccess function associated with this form.. I do have OnSelect that is associated with the Submit button but that is the closest thing that I see, to what you are describing.. Is there a way for me to add this functionality?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,991)