Flow Designer - Inbound Email to HTML Field Catalog Variable

Community Alums
Not applicable

Hi all, 

I have an interesting requirement that I'm very much struggling with. 

The end goal: When an inbound email with the desired conditions is received, it triggers a flow.  The flow submits a catalog item request.  This catalog item has a HTML variable that should contain the exact contents of the email. 

The issue is that no matter what I try, the variable once the cat item is submitted doesn't display in a desirable way at all.  It's either blank, formatted in an unreadable manner or errors.  

I even created a new HTML field on the sys_email table and set the value of it to be identical to the body field and used that in the flow, but still no luck. 

This is how the action is set up: 

find_real_file.png

I believe I need to set the value of this HTML field but I cannot find a way to do this in flow designer.

 

This is the closest I've got, pulling the body field through into the variable whilst having it as multi-line text instead, but it's unacceptable as it's hard to read in this format:

find_real_file.png

 

Any assistance would be greatly appreciated.  Is this a limitation of flow designer? I've tried doing the same with a simple inbound action but even that is failing!  

thanks

Harrison

1 ACCEPTED SOLUTION

Kev9
Kilo Sage

Maybe create an action to convert the body to HTML and then update the variable?

Following may be of assistance

https://community.servicenow.com/community?id=community_question&sys_id=31adb7bc1b0bec900b8a9979b04bcbec

View solution in original post

4 REPLIES 4

Kev9
Kilo Sage

Hi,

 

Have you tried using instead of ?

 

REgards,

 

Kev

Kev9
Kilo Sage

Maybe create an action to convert the body to HTML and then update the variable?

Following may be of assistance

https://community.servicenow.com/community?id=community_question&sys_id=31adb7bc1b0bec900b8a9979b04bcbec

Community Alums
Not applicable

Hi Kev, 

This actually worked perfectly.  Thanks for the recommendation!  

This also has the added bonus of being useful in the future I'm sure. 

AnirudhKumar
Mega Sage
Mega Sage

I suggest use the Catalog Item API script in your flow designer rather than the OOB 'Submit Catalog Item Request' Action.

var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('e46305bdc0a8010a00645e608031eb0f');

//the variable 'fieldValue' will be dynamic - from the email body
cart.setVariable(item,'fieldName','fieldValue');

var rc = cart.placeOrder();