Skip to content

Commit 7ee5a04

Browse files
authored
Merge pull request #114642 from ecfan/flat-file
Update screenshots and content for encoding and decoding flat files
2 parents 127eafe + d14402c commit 7ee5a04

13 files changed

+55
-45
lines changed
Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,103 @@
11
---
22
title: Encode or decode flat files
3-
description: Encode or decode flat files for enterprise integration with Azure Logic Apps and Enterprise Integration Pack
3+
description: Encode or decode flat files for enterprise integration in Azure Logic Apps by using the Enterprise Integration Pack
44
services: logic-apps
55
ms.suite: integration
66
author: divyaswarnkar
77
ms.author: divswa
88
ms.reviewer: jonfan, estfan, logicappspm
99
ms.topic: article
10-
ms.date: 07/08/2016
10+
ms.date: 05/09/2020
1111
---
1212

13-
# Encode or decode flat files with Azure Logic Apps and Enterprise Integration Pack
13+
# Encode and decode flat files in Azure Logic Apps by using the Enterprise Integration Pack
1414

15-
You may want to encode XML content before you send it to a business partner in a business-to-business (B2B) scenario. In a logic app, you can use the flat file encoding connector to do this. The logic app that you create can get its XML content from a variety of sources, including from an HTTP request trigger, from another application, or even from one of the many [connectors](../connectors/apis-list.md). For more information about logic apps, see the [logic apps documentation](logic-apps-overview.md "Learn more about Logic apps").
15+
Before you send XML content to a business partner in a business-to-business (B2B) scenario, you might want to encode that content first. By building a logic app, you can encode and decode flat files by using the **Flat File** connector. Your logic app can get this XML content from various sources, such as the Request trigger, another app, or other [connectors supported by Azure Logic Apps](../connectors/apis-list.md). For more information, see [What is Azure Logic Apps](logic-apps-overview.md)?
1616

17-
## Create the flat file encoding connector
18-
Follow these steps to add a flat file encoding connector to your logic app.
17+
## Prerequisites
1918

20-
1. Create a logic app and [link it to your integration account](logic-apps-enterprise-integration-accounts.md "Learn to link an integration account to a Logic app"). This account contains the schema you will use to encode the XML data.
19+
* An Azure subscription. If you don't have a subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/).
2120

22-
1. In the Logic App Designer, add the **When an HTTP request is received** trigger to your logic app.
21+
* The logic app where you want to use the **Flat File** connector and a trigger that starts your logic app's workflow. The **Flat File** connector provides only actions, not triggers. You can use either the trigger or another action to feed the XML content into your logic app for encoding or decoding. If you're new to logic apps, review [Quickstart: Create your first logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md).
2322

24-
1. Add the flat file encoding action, as follows:
23+
* An [integration account](../logic-apps/logic-apps-enterprise-integration-create-integration-account.md) that's associated with your Azure subscription and [linked to the logic app](logic-apps-enterprise-integration-accounts.md#link-account) where you plan to use the **Flat File** connector. Both your logic app and integration account must exist in the same location or Azure region.
2524

26-
a. Select the **plus** sign.
25+
* A flat file [schema](logic-apps-enterprise-integration-schemas.md) that you've uploaded to your integration account for encoding or decoding the XML content
2726

28-
b. Select the **Add an action** link (appears after you have selected the plus sign).
27+
* At least two [trading partners](logic-apps-enterprise-integration-partners.md) that you've already defined in your integration account
2928

30-
c. In the search box, enter *Flat* to filter all the actions to the one that you want to use.
29+
## Add flat file encode action
3130

32-
d. Select the **Flat File Encoding** option from the list.
31+
1. In the [Azure portal](https://portal.azure.com), open your logic app in the Logic App Designer.
3332

34-
![Screenshot of Flat File Encoding option](media/logic-apps-enterprise-integration-flatfile/flatfile-2.png)
33+
1. Under the trigger or action in your logic app, select **New step** > **Add an action**. This example uses the Request trigger, which is named **When a HTTP request is received**, and handles inbound requests from outside the logic app.
3534

36-
1. On the **Flat File Encoding** dialog box, select the **Content** text box.
35+
> [!TIP]
36+
> Providing a JSON schema is optional. If you have a sample payload from the inbound request,
37+
> select **Use sample payload to generate schema**, enter the sample payload, and select **Done**.
38+
> The schema appears in the **Request Body JSON Schema** box.
3739
38-
![Screenshot of Content text box](media/logic-apps-enterprise-integration-flatfile/flatfile-3.png)
40+
1. Under **Choose an action**, enter `flat file`. From the actions list, select this action: **Flat File Encoding**
3941

40-
1. Select the body tag as the content that you want to encode. The body tag will populate the content field.
42+
![Select "Flat File Encoding" action](./media/logic-apps-enterprise-integration-flatfile/select-flat-file-encoding.png)
4143

42-
![Screenshot of body tag](media/logic-apps-enterprise-integration-flatfile/flatfile-4.png)
44+
1. Click inside the **Content** box so that the dynamic content list appears. From the list, in the **When a HTTP request is received** section, select the **Body** property, which contains the request body output from the trigger and the content to encode.
4345

44-
1. Select the **Schema Name** list box, and choose the schema you want to use to encode the input content.
46+
![Select content to encode from dynamic content list](./media/logic-apps-enterprise-integration-flatfile/select-content-to-encode.png)
4547

46-
![Screenshot of Schema Name list box](media/logic-apps-enterprise-integration-flatfile/flatfile-5.png)
48+
> [!TIP]
49+
> If you don't see the **Body** property in the dynamic content list,
50+
> select **See more** next to the **When a HTTP request is received** section label.
51+
> You can also directly enter the content to decode in the **Content** box.
4752
48-
1. Save your work.
53+
1. From the **Schema Name** list, select the schema that's in your linked integration account to use for encoding, for example:
4954

50-
![Screenshot of Save icon](media/logic-apps-enterprise-integration-flatfile/flatfile-6.png)
55+
![Select schema to use for encoding](./media/logic-apps-enterprise-integration-flatfile/select-schema-for-encoding.png)
5156

52-
At this point, you are finished setting up your flat file encoding connector. In a real world application, you may want to store the encoded data in a line-of-business application, such as Salesforce. Or you can send that encoded data to a trading partner. You can easily add an action to send the output of the encoding action to Salesforce, or to your trading partner, by using any one of the other connectors provided.
57+
> [!NOTE]
58+
> If no schema appears in the list, your integration account doesn't contain any schema files to use for encoding.
59+
> Upload the schema that you want to use to your integration account.
5360
54-
You can now test your connector by making a request to the HTTP endpoint, and including the XML content in the body of the request.
61+
1. Save your logic app. To test your connector, make a request to the HTTPS endpoint, which appears in the Request trigger's **HTTP POST URL** property, and include the XML content that you want to encode in the request body.
5562

56-
## Create the flat file decoding connector
63+
You're now done with setting up your flat file encoding action. In a real world app, you might want to store the encoded data in a line-of-business (LOB) app, such as Salesforce. Or, you can send the encoded data to a trading partner. To send the output from the encoding action to Salesforce or to your trading partner, use the other [connectors available in Azure Logic Apps](../connectors/apis-list.md).
5764

58-
> [!NOTE]
59-
> To complete these steps, you need to have a schema file already uploaded into you integration account.
65+
## Add flat file decode action
6066

61-
1. In the Logic App Designer, add the **When an HTTP request is received** trigger to your logic app.
67+
1. In the [Azure portal](https://portal.azure.com), open your logic app in the Logic App Designer.
6268

63-
1. Add the flat file decoding action, as follows:
69+
1. Under the trigger or action in your logic app, select **New step** > **Add an action**. This example uses the Request trigger, which is named **When a HTTP request is received**, and handles inbound requests from outside the logic app.
6470

65-
a. Select the **plus** sign.
71+
> [!TIP]
72+
> Providing a JSON schema is optional. If you have a sample payload from the inbound request,
73+
> select **Use sample payload to generate schema**, enter the sample payload, and select **Done**.
74+
> The schema appears in the **Request Body JSON Schema** box.
6675
67-
b. Select the **Add an action** link (appears after you have selected the plus sign).
76+
1. Under **Choose an action**, enter `flat file`. From the actions list, select this action: **Flat File Decoding**
6877

69-
c. In the search box, enter *Flat* to filter all the actions to the one that you want to use.
78+
![Select "Flat File Decoding" action](./media/logic-apps-enterprise-integration-flatfile/select-flat-file-decoding.png)
7079

71-
d. Select the **Flat File Decoding** option from the list.
80+
1. Click inside the **Content** box so that the dynamic content list appears. From the list, in the **When a HTTP request is received** section, select the **Body** property, which contains the request body output from the trigger and the content to decode.
7281

73-
![Screenshot of Flat File Decoding option](media/logic-apps-enterprise-integration-flatfile/flatfile-2.png)
82+
![Select content to decode from dynamic content list](./media/logic-apps-enterprise-integration-flatfile/select-content-to-decode.png)
7483

75-
1. Select the **Content** control. This produces a list of the content from earlier steps that you can use as the content to decode. Notice that the *Body* from the incoming HTTP request is available to be used as the content to decode. You can also enter the content to decode directly into the **Content** control.
84+
> [!TIP]
85+
> If you don't see the **Body** property in the dynamic content list,
86+
> select **See more** next to the **When a HTTP request is received** section label.
87+
> You can also directly enter the content to decode in the **Content** box.
7688
77-
1. Select the *Body* tag. Notice the body tag is now in the **Content** control.
89+
1. From the **Schema Name** list, select the schema that's in your linked integration account to use for decoding, for example:
7890

79-
1. Select the name of the schema that you want to use to decode the content. The following screenshot shows that *OrderFile* is the selected schema name. This schema name had been uploaded into the integration account previously.
91+
![Select schema to use for decoding](./media/logic-apps-enterprise-integration-flatfile/select-schema-for-decoding.png)
8092

81-
![Screenshot of Flat File Decoding dialog box](media/logic-apps-enterprise-integration-flatfile/flatfile-decode-1.png)
93+
> [!NOTE]
94+
> If no schema appears in the list, your integration account doesn't contain any schema files to use for decoding.
95+
> Upload the schema that you want to use to your integration account.
8296
83-
1. Save your work.
97+
1. Save your logic app. To test your connector, make a request to the HTTPS endpoint, which appears in the Request trigger's **HTTP POST URL** property, and include the XML content that you want to decode in the request body.
8498

85-
![Screenshot of Save icon](media/logic-apps-enterprise-integration-flatfile/flatfile-6.png)
86-
87-
At this point, you are finished setting up your flat file decoding connector. In a real world application, you may want to store the decoded data in a line-of-business application such as Salesforce. You can easily add an action to send the output of the decoding action to Salesforce.
88-
89-
You can now test your connector by making a request to the HTTP endpoint and including the XML content you want to decode in the body of the request.
99+
You're now done with setting up your flat file decoding action. In a real world app, you might want to store the decoded data in a line-of-business (LOB) app, such as Salesforce. Or, you can send the decoded data to a trading partner. To send the output from the decoding action to Salesforce or to your trading partner, use the other [connectors available in Azure Logic Apps](../connectors/apis-list.md).
90100

91101
## Next steps
92-
* [Learn more about the Enterprise Integration Pack](logic-apps-enterprise-integration-overview.md "Learn about Enterprise Integration Pack").
93102

103+
* Learn more about the [Enterprise Integration Pack](logic-apps-enterprise-integration-overview.md)
34.8 KB
Loading
34.8 KB
Loading
60.3 KB
Loading

0 commit comments

Comments
 (0)