Inbound Action - Email working with Flow Designer / Reference Field population.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 07:02 AM
Hello Everyone!
I have an issue where I can't seem to get my Reference variables to populate information while I work in Flow Designer. I'm using the Inbound Email Action to ingest emails based on specified conditions. That seems to be working fine without issue. I then use the "Create Record" action to create an Incident record off of that email. That also seems to be working just fine. I have a few different variables I'm populating based on the Email within the Incident automatically.
The problem I'm facing is the Inbound Email has a line of text that states the Assignment Group the incident needs to be assigned (e.g. Assignment Group: Database Administrators)
Based on this Assignment Group line of text... I need to ensure the incident is assigned to the appropriate Assignment Group. This assignment group is a reference field. I don't have much experience with using Inline Scripts... which from my understanding the Reference Fields within the Flow Designer require.
Any and all help would be appreciated!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 01:38 AM
Hi Stuart,
have you been able to pull the values from body text 'variable:value' pairs?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 04:56 AM
Hi Vladimir,
I did start to get it figured out, but for a few reasons my progress on that front got shelved. Essentially my difficulty was trying to get info out of HTML content as well (which was a real pain). For the content that was plain text though and had the correct key:value (or key:#value# in my case) format I did get that working using the workflow.
I ended up making a custom action that was a "script" type and then used that.
So in my flow, I had the trigger, then a lookup record to get the email record out of the sys_email table (using sys_id from the trigger) and then from there into my custom action.
The custom action had the email body passed in to a variable that I could then use/pull apart/dissect using scripting, to extract the values I needed, which I passed into output variables that had names that aligned with the keys.
The output variables could then be used in the flow to populate into fields of the destination table as required.
The legacy method of using inbound actions is still much quicker.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 07:47 AM
Thank you Stuart. I resolved this for myself by using .substring(). I believe, my emails are HTML.
var index = fd_data.trigger.inbound_email.body_text.indexOf("Seriennummer:");
var sn = fd_data.trigger.inbound_email.body_text.substring(index+14,index+25);
Flow Designer is easier, if you need to dot-walk through 2+ reference records. The User Interface needs though more improvements:
-one click wrong, and you need to re-write your script.
-very often you do not know, what you are saving, activating or testing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 01:29 PM
would love to see your whole script- i'm working to parse some stuff that is not name:value pairs- and has multiple emails in it I need to retrieve into a variable. thinking your 'index and substring' solution might be an answer for me.