Skip to content

Instantly share code, notes, and snippets.

@sbutterfield
Created November 10, 2022 15:11
Show Gist options
  • Save sbutterfield/9881b33e18aa96c7894a427349470e4d to your computer and use it in GitHub Desktop.
Save sbutterfield/9881b33e18aa96c7894a427349470e4d to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<assignments>
<name>Assign_Knowledge_Prefill_Info</name>
<label>Assign Knowledge Prefill Info</label>
<locationX>176</locationX>
<locationY>758</locationY>
<assignmentItems>
<assignToReference>knowledgeArticle.Title</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Get_Incident.Subject</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>knowledgeArticle.Summary</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>KnowledgeSummary</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>knowledgeArticle.UrlName</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>knowledgeURL</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Enter_Knowledge_Details</targetReference>
</connector>
</assignments>
<description>This is a screen flow template that allows the user to quickly create a knowledge article from pre-filled Title/Summary fields from incident/problem/change request information.</description>
<environments>Default</environments>
<formulas>
<name>KnowledgeSummary</name>
<dataType>String</dataType>
<expression>RIGHT({!Get_Incident.Description} &amp; BR() &amp; BR() &amp;
&apos;Problem: &apos; &amp; {!Get_Problem.Subject} &amp; BR() &amp;
&apos;Change Request: &apos; &amp; {!Get_Change_Request.Subject}, 1000)</expression>
</formulas>
<formulas>
<name>knowledgeURL</name>
<dataType>String</dataType>
<expression>SUBSTITUTE(URLENCODE(SUBSTITUTE({!Get_Incident.Subject} &amp; &apos;-&apos; &amp; {!Get_Incident.IncidentNumber}, &apos; &apos;, &apos;&apos;)), &apos;%&apos;, &apos;&apos;)</expression>
</formulas>
<interviewLabel>AIM - Create Knowledge Article {!$Flow.CurrentDateTime}</interviewLabel>
<isTemplate>true</isTemplate>
<label>AIM - Create Knowledge Article</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>Flow</processType>
<recordCreates>
<name>Create_Knowledge_Article</name>
<label>Create Knowledge Article</label>
<locationX>176</locationX>
<locationY>998</locationY>
<connector>
<targetReference>Refresh_Knowledge_Article</targetReference>
</connector>
<inputReference>knowledgeArticle</inputReference>
</recordCreates>
<recordLookups>
<name>Get_Change_Request</name>
<label>Get Change Request</label>
<locationX>176</locationX>
<locationY>638</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Assign_Knowledge_Prefill_Info</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Change_Request_Related_Issue.ChangeRequestId</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>ChangeRequest</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Change_Request_Related_Issue</name>
<label>Get Change Request Related Issue</label>
<locationX>176</locationX>
<locationY>518</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_Change_Request</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>RelatedIssueId</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Problem.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>ChangeRequestRelatedIssue</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Incident</name>
<label>Get Incident</label>
<locationX>176</locationX>
<locationY>158</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_Related_Problem_Incident</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>incidentId</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Incident</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Problem</name>
<label>Get Problem</label>
<locationX>176</locationX>
<locationY>398</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_Change_Request_Related_Issue</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Related_Problem_Incident.RelatedIssueId</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Problem</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Related_Problem_Incident</name>
<label>Get Related Problem Incident</label>
<locationX>176</locationX>
<locationY>278</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_Problem</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>IssueId</field>
<operator>EqualTo</operator>
<value>
<elementReference>incidentId</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>ProblemIncident</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Refresh_Knowledge_Article</name>
<label>Refresh Knowledge Article</label>
<locationX>176</locationX>
<locationY>1118</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Complete</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>knowledgeArticle.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Knowledge__kav</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<screens>
<name>Complete</name>
<label>Complete</label>
<locationX>176</locationX>
<locationY>1238</locationY>
<allowBack>false</allowBack>
<allowFinish>true</allowFinish>
<allowPause>true</allowPause>
<fields>
<name>check</name>
<extensionName>flowruntime:image</extensionName>
<fieldType>ComponentInstance</fieldType>
<inputParameters>
<name>imageName</name>
<value>
<stringValue>aim_check</stringValue>
</value>
</inputParameters>
<inputParameters>
<name>horizontalAlignment</name>
<value>
<stringValue>center</stringValue>
</value>
</inputParameters>
<inputParameters>
<name>imageWidth</name>
<value>
<stringValue>50</stringValue>
</value>
</inputParameters>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
<storeOutputAutomatically>true</storeOutputAutomatically>
</fields>
<fields>
<name>CompleteText</name>
<fieldText>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;{!$Label.AIM_Flow_CreateKB_Complete}&lt;/span&gt;&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<screens>
<name>Enter_Knowledge_Details</name>
<label>Enter Knowledge Details</label>
<locationX>176</locationX>
<locationY>878</locationY>
<allowBack>true</allowBack>
<allowFinish>true</allowFinish>
<allowPause>true</allowPause>
<connector>
<targetReference>Create_Knowledge_Article</targetReference>
</connector>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.Title</objectFieldReference>
</fields>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.Summary</objectFieldReference>
</fields>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.Language</objectFieldReference>
</fields>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.UrlName</objectFieldReference>
</fields>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.IsVisibleInCsp</objectFieldReference>
</fields>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.IsVisibleInPrm</objectFieldReference>
</fields>
<fields>
<fieldType>ObjectProvided</fieldType>
<isRequired>false</isRequired>
<objectFieldReference>knowledgeArticle.IsVisibleInPkb</objectFieldReference>
</fields>
<nextOrFinishButtonLabel>Create Article</nextOrFinishButtonLabel>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Incident</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>incidentId</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>knowledgeArticle</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>true</isOutput>
<objectType>Knowledge__kav</objectType>
</variables>
</Flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment