cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joshieboy
Helper V
Helper V

Sending Email based on modified field

I have a flow setup where I would like to send an email to a specific group of users if a record has been modified and a specific value entered in a field.  So when forms are submitted, they are assigned to individuals for action.  There are two fields on the form that should trigger the action.  

 

1.  Is submission an IIN - this is a Yes/No dropdown

2.  Incident type Sub Category - this is also a dropdown and has multiple values

 

I want when a form is modified, if the Is Submission an IIN field equals Yes, and Incident type Sub Category equals "First Aid" or "Medical Treatment", then send an email to lets call it Group A users.  

 

If however Is Submission an IIN field equals Yes, and anything else from the Incident type Sub Category field is selected, then send an email to lets call it Group B users.

 

Finally, if the Is Submission an IIN field equals No, send an email to the person who created the form.  Once someone selects no, they will not advance to the Incident type sub category field so there is no need to include this piece. I created a separate flow for this one where its almost the same as the screenshot below - when an item or file is modified, if Is Submission an IIN equals No send an email to Created by.  This seems to work but it also sends another email to the group A which I am not sure why as the groups trigger should be based on "Yes" and not No.  I am thinking that all conditions can be satisfied with one flow but would really like some guidance on this.  Thanks in advance.

 

 

Below is a screenshot of my attempt for the Yes (Medical Treatment or First Aid) piece. IINFlow.jpg

8 REPLIES 8
powercorner
Responsive Resident
Responsive Resident

Hello @joshieboy ,

 

your condition inside the flow does not fit to your described text:

 

I want when a form is modified, if the Is Submission an IIN field equals Yes, and Incident type Sub Category equals "First Aid" or "Medical Treatment", then send an email to lets call it Group A users.   

 

So what you want is an (Submission = Yes AND Incident = First Aid) OR (Submission = Yes AND Incident = Medical Treatment)

 

but your condition in the flow says:  
(Submission = Yes AND Incident = Medical Treatment AND (Submission = Yes OR Incident = First Aid) )

So the first aid is not really counting in your logical expression. your condition should look like this:

powercorner_0-1621796398273.png

 

Tell me if this helped you.

 

With regards

Kevin 

 

Hi @powercorner - thanks for the feedback.  I tried this and no matter which option I select, the workflow still sends the email to the same group.  If I select First Aid or Medical Treatment or any other option from the dropdown, it goes to the same group.  Although I had two different email groups.  One for If Yes and one for If No.  Below is my screenshot of what you suggested. 

 

Condition.jpg

hey there,

 

what do you exactly mean? is this condition always true? Can you show me the runtime outputs? just to make sure. can you store the sharepoint data in 2 variables to have a clearness over the output?

Hi @powercorner  - Can I email the runtime file to you?

Also, there are several options on the dropdown - eg:   Process Upset, Equipment Failure, LOPC, Property Damage, etc.  inclusive of First Aid and Medical Treatment and several others.  The workflow should send the email to a specific group only if First Aid or Medical Treatment is selected from the dropdown.  If anything else is selected from the dropdown, it should go to another group of users.  

 

Can you walk me through the two variables part.  Thanks. 

hey @joshieboy ,

 

all right. So with emailing a group you mean that the outcome of the condition is true or false. And when its true your send a mail to group A and when its false you send a mail to group B?

 

I would try to build a copy of your flow and SP list. give me a second.

 

With regards

Kevin

 

powercorner
Responsive Resident
Responsive Resident

oh man @joshieboy 

 

now I see your problem. You have to use true instead of Yes in the condition:

powercorner_0-1621967565183.png

(sry its in german -> oder = or , und = and, ist gleich = equals )

 

you can find the info in the output of your sharepoint trigger:

powercorner_2-1621967858033.png

 

powercorner_1-1621967841885.png

 

 

With regards

Kevin

Hi @powercorner - your screenshot helps.  See mine below.  I am not sure why for Is Submission an IIN, I am not seeing a value in my raw input.  Can you provide some guidance on this?  

 

{"headers":{"Transfer-Encoding":"chunked","Retry-After":"21600","Vary":"Origin,Accept-Encoding","X-SharePointHealthScore":"1","X-MS-SPConnector":"1","X-SP-SERVERSTATE":"ReadOnly=0","DATASERVICEVERSION":"3.0","SPClientServiceRequestDuration":"154","SPRequestGuid":"38a34c06-8a71-4f27-980e-7b48ccd4acb8","request-id":"38a34c06-8a71-4f27-980e-7b48ccd4acb8","MS-CV":"BkyjOHGKJ0+YDntIzNSsuA.0","Strict-Transport-Security":"max-age=31536000","X-FRAME-OPTIONS":"SAMEORIGIN","Content-Security-Policy":"frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.stream.azure-test.net *.microsoftstream.com;","MicrosoftSharePointTeamServices":"16.0.0.21312","X-Content-Type-Options":"nosniff","X-MS-InvokeApp":"1; RequireReadOnly","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","Cache-Control":"max-age=0, private","Date":"Wed, 26 May 2021 15:42:10 GMT","Location":"https://flow-apim-msmanaged-na-eastus2-01.azure-apim.net/apim/sharepointonline/0aa531bd2c2647b7accfa484cb7ade15/datasets/https%253A%252F%252Fngc1.sharepoint.com%252Fhse_security%252Fiinportal/tables/f335fc5d-4c16-47e6-81ba-52edc5e39ee3/onchangeditems?triggerstate=MTszO2YzMzVmYzVkLTRjMTYtNDdlNi04MWJhLTUyZWRjNWUzOWVlMzs2Mzc1NzY0MDUzMDc2NzAwMDA7NDA1MjM4MTcz","P3P":"CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"","X-AspNet-Version":"4.0.30319","X-Powered-By":"ASP.NET","Content-Type":"application/json; charset=utf-8","Expires":"Tue, 11 May 2021 15:42:10 GMT","Last-Modified":"Wed, 26 May 2021 15:42:10 GMT","Content-Length":"4738"},"body":{"@odata.etag":"\"2\"","ItemInternalId":"100","ID":100,"Created":"2021-05-26T15:39:53Z","Author":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|jgaskin@ngc.co.tt","DisplayName":"Joshua Gaskin","Email":"joshua.gaskin@ngc.co.tt","Picture":"https://ngc1.sharepoint.com/hse_security/iinportal/_layouts/15/UserPhoto.aspx?Size=L&AccountName=joshua.gaskin@ngc.co.tt","Department":"Information Technology Department","JobTitle":"Business Analyst"},"Author#Claims":"i:0#.f|membership|jgaskin@ngc.co.tt","Division":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":26,"Value":"Technology and Innovation"},"Division#Id":26,"Department":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":50,"Value":"Enterprise Planning Implementation and Transformation"},"Department#Id":50,"IncidentLocation":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":6,"Value":"Pacific Place"},"IncidentLocation#Id":6,"FirstLevelReviewer":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|jgaskin@ngc.co.tt","DisplayName":"Joshua Gaskin","Email":"joshua.gaskin@ngc.co.tt","Picture":"https://ngc1.sharepoint.com/hse_security/iinportal/_layouts/15/UserPhoto.aspx?Size=L&AccountName=joshua.gaskin@ngc.co.tt","Department":"Information Technology Department","JobTitle":"Business Analyst"},"FirstLevelReviewer#Claims":"i:0#.f|membership|jgaskin@ngc.co.tt","IncidentDateandTime":"2021-05-25T09:00:00Z","DescriptionofIncident":"May 26th test 1 for Incident type","ImmediateActionstobetaken":"May 26th test 1 for Incident type","On_x002d_Time_x0020_Reporting":"No","Date_x0020_Difference":"1.27769675925811","ImpactLevel":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"3"},"ImpactLevel#Id":2,"Likelihood":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":3,"Value":"4"},"Likelihood#Id":3,"Outcome":"Medium (12)","Grade":"12","ImpactxLikelihood":"Moderate/Likely","Investigation_x0020_Level":"2","Incidenttype":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Accident"},"Incidenttype#Id":0,"Incidenttype_x002d_SubCategory":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":-1,"Value":"First Aid"},"Incidenttype_x002d_SubCategory#Id":-1,"Investigation_x0020_Status":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":3,"Value":"Open"},"Investigation_x0020_Status#Id":3,"Safety_x0020_Critical_x0020_Equi":"First Aid submission.  This should go to gmail account","Is_x0020_submission_x0020_an_x00":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Yes"},"Is_x0020_submission_x0020_an_x00#Id":0,"Date_x0020_and_x0020_Time_x0020_":"2021-05-25T09:00:00Z","AmorPm":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"AM"},"AmorPm#Id":0,"Modified":"2021-05-26T15:41:40Z","Editor":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|jgaskin@ngc.co.tt","DisplayName":"Joshua Gaskin","Email":"joshua.gaskin@ngc.co.tt","Picture":"https://ngc1.sharepoint.com/hse_security/iinportal/_layouts/15/UserPhoto.aspx?Size=L&AccountName=joshua.gaskin@ngc.co.tt","Department":"Information Technology Department","JobTitle":"Business Analyst"},"Editor#Claims":"i:0#.f|membership|jgaskin@ngc.co.tt","IINNumber":"IIN","{Identifier}":"Lists%252fInitial%2bIncident%2bNotification%252f100_.000","{IsFolder}":false,"{Thumbnail}":{"Large":null,"Medium":null,"Small":null},"{Link}":"https://ngc1.sharepoint.com/hse_security/iinportal/_layouts/15/listform.aspx?PageType=4&ListId=f335fc5d%2D4c16%2D47e6%2D81ba%2D52edc5e39ee3&ID=100&ContentTypeID=0x010074CD10EF2285B84C85B5791C9A6393C6009732AD8FC4D3E04E9293C778488500C6","{Name}":"","{FilenameWithExtension}":"","{Path}":"Lists/Initial Incident Notification/","{FullPath}":"Lists/Initial Incident Notification/100_.000","{ContentType}":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType","Id":"0x010074CD10EF2285B84C85B5791C9A6393C6009732AD8FC4D3E04E9293C778488500C6","Name":"Item"},"{ContentType}#Id":"0x010074CD10EF2285B84C85B5791C9A6393C6009732AD8FC4D3E04E9293C778488500C6","{HasAttachments}":false,"{VersionNumber}":"2.0","{TriggerWindowStartToken}":"MTszO2YzMzVmYzVkLTRjMTYtNDdlNi04MWJhLTUyZWRjNWUzOWVlMzs2Mzc1NzY0MDQyMzIxMDAwMDA7NDA1MjM3Mzk5","{TriggerWindowEndToken}":"MTszO2YzMzVmYzVkLTRjMTYtNDdlNi04MWJhLTUyZWRjNWUzOWVlMzs2Mzc1NzY0MDUzMDc2NzAwMDA7NDA1MjM4MTcz"}}

 

Hey @joshieboy ,

 

this is how an choice field normally looks in SharePoint:  "Is_x0020_submission_x0020_an_x00":{"@odata.type":"#Microso
ft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Yes"}

See here:

powercorner_0-1622052352875.pngpowercorner_1-1622052365098.png

 

are you sure its not a choice field? In case if its possible just delete that "broken" column from your SP List and create a new one (Yes/No) with the same name.

 

Otherwise you can select the triggerOutput()['Is_x0020_submission_x0020_an_x00/Value'] in the condition

powercorner_2-1622052501683.png

 

This should help 4 sure!

 

With regards

Kevin

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,406)