cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Continued Contributor
Continued Contributor

Salesforce: 'is equal to matches email, but 'ends with' does not match domain part of the email.

Hi all, 

 

I am beginning to try out some integration with Salesforce using Premium connectors. 

 

In my first exercise, I want to just list all Salesforce users with a Username that matches between SF and O365. 

 

I have created 3 variables: 

 

One integer to count all Users in SF. 

One integer to count all matches. 
One string to concatenate all Usernames that matched, one per line. 

 

Send an email to myself with all 3 variables in the body.

 

In my first exercise, I just listed all usernames and everything worked perfectly.

 

In my second exercise, I used a Flow Conditional with the rule: 

Salesforce Username is equal to username@contoso.com (email omitted for privacy). This worked perfectly. 

Advanced mode: (email omitted)

@equals(items('Aplicar_a_cada')?['Username'], 'username@contoso.com')

My variable counting matched resulted in 1 match, which is what I expected. 

 

In my third exercise, I changed the 'equal to' to 'ends with', and used only my domain name.

Advanced mode: (domain omitted)

@endswith(items('Aplicar_a_cada')?['Username'], '@contoso.com)

 

This yielded no matches. The variable to count matches stood at 0 and no emails were listed. 

 

I can't understand why it had this result. Perhaps it needs a special syntax? 

 

 

 

 

2 REPLIES 2
Community Support
Community Support

Hi @TiagoFreire,

 

I find that you are missing a single quote in your expression,

Please modify the expression to:

@endswith(items('Aplicar_a_cada')?['Username'], '@contoso.com')

Best regards,

Alice

I double checked that. the single quote was missing on this post but not on the flow code. 

Flow wouldn`t even save if there was a syntax error. 

 

The flow code runs, but does not yield any results. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,095)